What You May Need to Know About Limitations on BPEL 2.0 IMA Support

Invoking an Asynchronous Web Service from a BPEL Process 8-11 Example 8–9 bpelx:conversationId Conversation ID in BPEL 2.0 invoke ... bpelx:conversationIdconvId1bpelx:conversationId invoke receive ... bpelx:conversationIdconvId1bpelx:conversationId receive onMessage ... bpelx:conversationIdconvId2bpelx:conversationId onMessage

8.3 Using a Dynamic Partner Link at Runtime

You can dynamically configure a partner link at runtime in BPEL. This is useful for scenarios in which the target service that BPEL wants to invoke is not known until runtime.

8.3.1 How To Add and Use a Dynamic Partner Link at Runtime

1. Create a WSDL file that contains multiple services that use the same portType.

2. Create a reference binding component entry in the composite.xml file that uses

the WSDL: reference name=loanService interface.wsdl interface=http:services.otn.comwsdl.interfaceLoanService callbackInterface=http:services.otn.comwsdl.interfaceLoanServiceCallback binding.ws port= http:services.otn.comwsdl.endpointAmericanLoanLoanService_pt reference 3. In the BPEL file, programmatically assign the partner link. For this example, UnitedLoan is one of the services defined in the WSDL. copy from EndpointReference xmlns=http:schemas.xmlsoap.orgws200303addressing Addresshttp:myhost.us.oracle.com:9700orabpeldefaultUnitedLoanAddress EndpointReference Note: Dynamic partner links are only supported in BPEL 1.1 projects. Notes: ■ Adding the binding.ws port setting is optional. This is because the port is overridden at runtime by properties passed from BPEL. ■ If there is no port setting, and there is no composite import of the concrete WSDL associated with this reference, you must specify the location of the concrete WSDL with a location attribute. 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