Carry out the following steps:
partnerlink_reference
. The schema of this variable is an element called service-ref
, which is defined in Service Reference Schema for WS-BPEL 2.0 (http://docs.oasis-open.org/wsbpel/2.0/serviceref). This element is used as an envelope to wrap the endpoint reference of a partner link. Here, we use WS-Addressing schema (http://schemas.xmlsoap.org/ws/2004/08/addressing) to represent an endpoint reference, as shown in the following screenshot:<assign>
activity named initialize_input_variable
and the <invoke>
activity named invoke_search_web_service
. This assign activity is used to initialize the variable that holds the endpoint data and then that value is assigned to the partner link, as shown in the following screenshot:<assign>
activity and go to the Copy Rules tab, which allows you to define data manipulation rules.partnerlink_reference
with a literal value as follows:<sref:service-ref xmlns:sref="http://docs.oasis-open.org/wsbpel/2.0/serviceref"> <EndpointReference xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:ns1="http://oracle. com/sca/soapservice/Fault_Handling_And _Signalling_Application/Fault_Handling_And_Signalling_Project/SearchService"> <ServiceName>ns1:search_bookstore</ServiceName> </EndpointReference> </sref:service-ref>
<forEach>
loop to the child element named ServiceName
of partnerlink_reference
, as follows:partnerlink_reference
variable and we can assign it to the partner link named bookstore_search_partner_link
. We can do that by just adding another copy rule to the <assign>
activity named initialize_partnerlink_reference
. Add another copy rule by connecting the partnerlink_reference
variable to the partner link named bookstore_search_partner_link
, as shown:In the preceding section, we focused on using a dynamic partner link to invoke the external web service. First, we create a new local variable named partnerlink_reference
that can handle partner link data. Then, we create another <assign>
activity that is used to initialize and assign endpoints to the partnerlink_reference
variable. Then we initialize that variable and assigned a dynamic endpoint based on the counter value of the <forEach>
activity. Finally, we assign the value of the partnerlink_reference
variable to the partner link named bookstore_search_partner_link
.
We have implemented the BPEL process up to the external service invocation. The remaining task is to combine all the responses from external web services to the response variable of the BPEL process, so the response message consists of data extracted from each bookstore relevant to the book specified by the request message to the BPEL process. For this task, we use a new <assign>
activity after the added <invoke>
activity and simply append the string returned by the <invoke>
activity to the output variable of the BPEL process.