Skip Headers
Oracle® Fusion Middleware User's Guide for Oracle B2B
11g Release 1 (

Part Number E10229-08
Go to Documentation Home
Go to Book List
Book List
Go to Table of Contents
Go to Index
Go to Feedback page
Contact Us

Go to previous page
Go to next page
PDF · Mobi · ePub

25 Programmatically Accessing Instance Message Data

This chapter provides an overview of the Instance Message Java API for programmatically accessing instance message data.

This chapter contains the following topics:

For more information about the Instance Message API, InstanceMessageUtil class, see Oracle Fusion Middleware B2B Instance Message Java API Reference.

25.1 Programmatically Accessing Instance Message Data

Instance Message Java API is a Java API provided in Oracle B2B to retrieve runtime data that is exchanged between Trading Partners.

Some Instance Message Java API use cases include:

Instance Message API queries the runtime data and provides results in the form of Instance data for various criteria. Instance Message API is a java wrapper on top of Instance Message View which encapsulates both business and wire messages.


When using this API, you must set additional libraries as part of the classpath in addition to b2b.jar and weblogic.jar or wlthint3client.jar.

Instance Message API Query Options

The Instance Message Java API enables you to retrieve the instance messages based on the following criteria:

For more information about the Instance Message API, see Oracle Fusion Middleware B2B Instance Message Java API Reference.

25.2 Instance Message Java API Examples

You can write your logic based on the out put of

Vector messages = (Vector) imUtil.getInstanceMessagesForTP("GlobalChips")

as shown in Example 25-1.

Another similar exposed method is getInstanceMessagesForMsgId(String messageId). All of the methods are documented in Oracle Fusion Middleware B2B Instance Message Java API Reference.

Example 25-1 Retrieval based on Trading Partner Name

import java.util.Vector;
import oracle.tip.b2b.utility.InstanceMessageUtil;
public class MyInstanceData {
    public static void main(String[] args) throws Exception {
        InstanceMessageUtil imUtil = new InstanceMessageUtil();
        Vector messages = (Vector) imUtil.getInstanceMessagesForTP("GlobalChips");

25.3 Troubleshooting Instance Message Java API

See the following topics for troubleshooting information:

25.3.1 Handling a Large Number of Messages

If the query returns a large number of messages then the weblogic.socket.MaxMessageSizeExceededException may occur.

To recover from this issue, increase weblogic.MaxMessageSize, and pass -Dweblogic.MaxMessageSize=100000000 in the client command line. This parameter setting will allow you to receive 100 MB messages.

For example:

java -cp
-Dweblogic.MaxMessageSize=100000000 TestInstanceMsg

25.3.2 Handing Large Payloads

Rather than return the payload itself, a large inbound or outbound payload will return as a reference to the location of the payload.

For example:



See Appendix A, "Handling Large Payloads" for more information about how Oracle B2B handles large payloads.

25.3.3 Executing Queries Remotely Using Weblogic.jar

If while using weblogic.jar and executing queries remotely you may see classpath issues for Oracle WebLogic Server, and the exception.

To recover, execute queries using wlthint3client.jar.

For example:

java -cp
/soa/modules/oracle.soa.b2b_11.1.1/b2b.jar TestInstanceMsg