What Happens When You Specify a Conversation ID

8-12 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite from to partnerLink=LoanService copy

8.4 Using WS-Addressing in an Asynchronous Service

Because there can be many active instances at any time, the server must be able to direct web service responses to the correct BPEL process service component instance. You can use WS-Addressing to identify asynchronous messages to ensure that asynchronous callbacks locate the appropriate client. Figure 8–3 provides an overview of WS-Addressing. WS-Addressing uses Simple Object Access Protocol SOAP headers for asynchronous message correlation. Messages are independent of the transport or application used. Figure 8–3 Callback with WS-Addressing Headers Figure 8–3 shows how messages are passed along with WS headers so that the response can be sent to the correct destination. The example in this chapter uses WS-Addressing for correlation. To view the messages, you can use TCP tunneling, which is described in Section 8.4.1.1, Using TCP Tunneling to See Messages Exchanged Between Programs. WS-Addressing defines the following information typically provided by transport protocols and messaging systems. This information is processed independently of the transport or application: ■ Endpoint location reply-to address The reply-to address specifies the location at which a BPEL client is listening for a callback message. ■ Conversation ID Initiate service invoke Wait for callback receive Async Loan Processor Service BPEL Process HelloWorld.bpel WSDL LoanService PartnerLink d3 loanApp variable d3 loanOffer variable WS-Addressing Header: · callback location · correlation id relatesTo d4 WS-Addressing Header: · correlation id relatesTo Note 1: the correlation id allows the BPEL server to know which instance of the process is waiting for this callback messages. Note 2: The alternative approach is to use content-based correlation using correlationSet d3 [2.05] receive [2.06] process [2.22] callback Initiate Port Callback Port Invoking an Asynchronous Web Service from a BPEL Process 8-13 Use TCP tunneling to view SOAP messages exchanged between the BPEL process service component flow and the web service including those containing the correlation ID. You can see the exact SOAP messages that are sent to, or received from, services with which a BPEL process service component flow communicates. You insert a software listener between your BPEL process service component flow and the web service. Your BPEL process service component flow communicates with the listener called a TCP tunnel. The listener forwards your messages to the web service, and also displays them. Responses from the web service are returned to the tunnel, which displays and forwards them back to the BPEL process service component.

8.4.1 How to Use WS-Addressing in an Asynchronous Service

WS-Addressing is a public specification and is the default correlation method supported by Oracle BPEL Process Manager. You do not need to edit the .bpel and .wsdl files to use WS-Addressing.

8.4.1.1 Using TCP Tunneling to See Messages Exchanged Between Programs

The messages that are exchanged between programs and services can be seen through TCP tunneling. This is particularly useful when you want to see the exact SOAP messages exchanged between the BPEL process service component flow and web services. To monitor the SOAP messages, insert a software listener between your flow and the service. Your flow communicates with the listener called a TCP tunnel and the listener forwards your messages to the service, and displays them. Likewise, responses from the service are returned to the tunnel, which displays them and then forwards them back to the flow. To see all the messages exchanged between the server and a web service, you need only a single TCP tunnel for synchronous services because all the pertinent messages are communicated in a single request and reply interaction with the service. For asynchronous services, you must set up two tunnels, one for the invocation of the service and another for the callback port of the flow.

8.4.1.1.1 Setting Up a TCP Listener for Synchronous Services Follow these steps to set up a

TCP listener for synchronous services initiated by an Oracle BPEL Process Manager process: 1. Visit the following URL for instructions on how to download and install Axis TCP Monitor tcpmon http:ws.apache.orgcommonstcpmon 2. Visit the following URL for instructions on how to use tcpmon: http:ws.apache.orgaxisjavauser-guide.html 3. Place axis.jar in your class path. 4. Start tcpmon: C:\...\ java org.apache.axis.utils.tcpmon localport remoteHost port_on_which_remote_server_is_running 5. In the composite.xml file, add the endpointURI property under binding.ws for your flow to override the endpoint of the service.