Enter the variable name and select Message Type from the options provided:

Invoking an Asynchronous Web Service from a BPEL Process 8-5 To add a receive activity: 1. From the Component Palette, drag a Receive activity to the location right after the Invoke activity you created in Section 8.2.1.2, Adding an Invoke Activity. 2. Create a variable to hold the receive information by invoking the Create Variable dialog, as you did in Step 3 through Step 7 of Section 8.2.1.2, Adding an Invoke Activity. Figure 8–2 shows the Create Variable dialog in BPEL 1.1. Figure 8–2 Create Variable Dialog

3. Double-click the receive activity and change its name to receive_invoke.

4. From the Partner Link list, select the partner link for this example, LoanService is

selected.

5. From the Operation list, select onResult. Do not select the Create Instance

checkbox.

6. Select the variable you created in Step 3 through Step 7 of

Section 8.2.1.2, Adding an Invoke Activity.

7. Click OK.

The receive activity and the output variable are created. Because the initial receive activity in the BPEL file for this example, LoanBroker.bpel created the initial BPEL process service component instance, a second instance does not need to be created.

8.2.1.4 Performing Additional Activities

In addition to the asynchronous-specific tasks, you must perform the following tasks. ■ Create an initial assign activity for data manipulation in front of the invoke activity that copies the client’s input variable loan application request document Not : In BPEL projects that support version 2.0 of the BPEL specification, the Create Variable dialog includes an Initialize tab that enables you to initialize the variable type inline for example, as a variable, expression, literal, partner link, or property. For more information, see Section 6.5.2, Initializing Variables with an Inline from-spec in BPEL 2.0. 8-6 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite payload into the loan application approver web service’s request variable payload. ■ Create a second assign activity for data manipulation after the receive activity that copies the loan application approver web service’s response variable loan application results payload into the output variable for the client to receive.

8.2.2 What Happens When You Invoke an Asynchronous Web Service

This section describes what happens when you invoke an asynchronous web service.

8.2.2.1 portType Section of the WSDL File

The portType section of the WSDL file in this example, for LoanService defines the ports to be used for the asynchronous service. Asynchronous services have two port types. Each port type performs a one-way operation. In this example, one port type responds to the asynchronous process and the other calls back the client with the asynchronous response. In the example shown in Example 8–1 , the portType LoanServiceCallback receives the client’s loan application request and the portType LoanService asynchronously calls back the client with the loan offer response. Example 8–1 portType Definition -- portType implemented by the LoanService BPEL process -- portType name=LoanService operation name=initiate input message=tns:LoanServiceRequestMessage operation portType -- portType implemented by the requester of LoanService BPEL process for asynchronous callback purposes -- portType name=LoanServiceCallback operation name=onResult input message=tns:LoanServiceResultMessage operation portType

8.2.2.2 partnerLinkType Section of the WSDL File

The partnerLinkType section of the WSDL file in this example, for LoanService defines the following characteristics of the BPEL process service component: ■ The role operation played ■ The portType provided for receiving messages within the conversation Partner link types in asynchronous services have two roles: one for the web service provider and one for the client requester. In the conversation shown in Example 8–2 , the LoanServiceProvider role and LoanService portType are used for client request messages and the LoanServiceRequester role and LoanServiceCallback portType are used for asynchronously returning calling back response messages to the client. Example 8–2 partnerLinkType Definition plnk:partnerLinkType name=LoanService plnk:role name=LoanServiceProvider