Introduction to Invoking an Asynchronous Web Service

Invoking an Asynchronous Web Service from a BPEL Process 8-3 Displays the BPEL process service component name for this example, LoanBroker appears. ■ WSDL URL Enter the name of the Web Services Description Language WSDL file to use. Click the SOA Resource Lookup icon above this field to locate the correct WSDL. ■ Partner Link Type Refers to the external service with which the BPEL process service component is to interface. Select from the list for this example, LoanService is selected. ■ Partner Role Refers to the role of the external source, for example, provider. Select from the list for this example, LoanServiceProvider is selected. ■ My Role Refers to the role of the BPEL process service component in this interaction. Select from the list for this example, LoanServiceRequester is selected.

8. Click OK.

A new partner link for the loan application approver web service United Loan appears in the swimlane of the designer.

8.2.1.2 Adding an Invoke Activity

Follow these instructions to create an invoke activity and a global input variable named request. This activity initiates the asynchronous BPEL process service component activity with the loan application approver web service United Loan. The loan application approver web service uses the request input variable to receive the loan request from the client. To add an invoke activity: 1. In the Component Palette, expand BPEL Constructs. 2. Drag an Invoke activity to beneath the Receive activity. 3. Go to the Structure window. Note that while this example describes variable creation from the Structure window, you can also create variables by clicking the Add icons to the right of the Input and Output fields of the Invoke dialog.

4. Right-click Variables and select Expand All Child Nodes.

5. In the second Variables folder in the tree, right-click and select Create Variable.

The Create Variable dialog appears.

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

■ Type This option lets you select an XML schema simple type for example, string, boolean, and so on. ■ Message Type This option enables you to select a WSDL message file definition of a partner link or of the project WSDL file of the current BPEL process service component for example, a response message or a request message. You can specify 8-4 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite variables associated with message types as input or output variables for invoke, receive, or reply activities. To display the message type, select the Message Type option, and then select its Browse icon to display the Type Chooser dialog. From here, expand the Message Types tree to make your selection. For this example, Message Types Partner Links Loan Service LoanService.wsdl Message Types LoanServiceRequestMessage is selected. ■ Element This option lets you select an XML schema element of the project schema file or project WSDL file of the current BPEL process service component, or of a partner link. Figure 8–1 shows the Create Variable dialog. Figure 8–1 Create Variable Dialog

7. Click OK.

8. Double-click the invoke activity to display the Invoke dialog.

9. In the Invoke dialog, select the partner link from the Partner Link list for this

example, LoanService is selected and initiate from the Operation list. 10. To the right of the Input field, click the second icon and select the input variable you created in Step 6. The Variable Chooser dialog appears, where you can select the variable. There is no output variable specified because the output variable is returned in the receive operation. The invoke activity is created. For more information about the invoke activity, see Section 8.2.2.5, Invoke and Receive Activities.

11. Click OK.

8.2.1.3 Adding a Receive Activity

Follow these steps to create a receive activity and a global output variable named response. This activity waits for the loan application approver web service’s callback operation. The loan application approver web service uses this output variable to send the loan offer result to the client.