How To Convert from a String to an XML Element

Manipulating XML Data in a BPEL Process 6-53 assign copy from expression=9.9 to variable=output part=payload query=payloadAPR copy assign

6.22 Manipulating SOAP Headers in BPEL

BPELs communication activities invoke, receive, reply, and onMessage receive and send messages through specified message variables. These default activities permit one variable to operate in each direction. For example, the invoke activity has inputVariable and outputVariable attributes. You can specify one variable for each of the two attributes. This is enough if the particular operation involved uses only one payload message in each direction. However, WSDL supports multiple messages in an operation. In the case of SOAP, multiple messages can be sent along the main payload message as SOAP headers. However, BPELs default communication activities cannot accommodate the additional header messages. Oracle BPEL Process Manager solves this problem by extending the default BPEL communication activities with the bpelx:headerVariable extension. The extension syntax is as shown in Example 6–104 : Example 6–104 bpelx:headerVariable Extension invoke bpelx:inputHeaderVariable=inHeader1 inHeader2 ... bpelx:outputHeaderVariable=outHeader1 outHeader2 ... ... receive bpelx:headerVariable=inHeader1 inHeader2 ... ... onMessage bpelx:headerVariable=inHeader1 inHeader2 ... ... reply bpelx:headerVariable=inHeader1 inHeader2 ... ...

6.22.1 How to Receive SOAP Headers in BPEL

This section provides an example of how to create BPEL and WSDL files to receive SOAP headers. To receive SOAP headers in BPEL: 1. Create a WSDL file that declares header messages and the SOAP binding that binds them to the SOAP request. Example 6–105 provides an example. Example 6–105 WSDL File Contents -- custom header -- message name=CustomHeaderMessage part name=header1 element=tns:header1 part name=header2 element=tns:header2 message binding name=HeaderServiceBinding type=tns:HeaderService soap:binding style=document transport=http:schemas.xmlsoap.orgsoaphttp operation name=initiate soap:operation style=document soapAction=initiate input soap:header message=tns:CustomHeaderMessage 6-54 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite part=header1 use=literal soap:header message=tns:CustomHeaderMessage part=header2 use=literal soap:body use=literal input operation binding 2. Create a BPEL source file that declares the header message variables and uses bpelx:headerVariable to receive the headers, as shown in Example 6–106 . Example 6–106 bpelx:headerVariable Use variables variable name=input messageType=tns:HeaderServiceRequestMessage variable name=event messageType=tns:HeaderServiceEventMessage variable name=output messageType=tns:HeaderServiceResultMessage variable name=customHeader messageType=tns:CustomHeaderMessage variables sequence -- receive input from requester -- receive name=receiveInput partnerLink=client portType=tns:HeaderService operation=initiate variable=input bpelx:headerVariable=customHeader createInstance=yes

6.22.2 How to Send SOAP Headers in BPEL

This section provides an example of how to send SOAP headers. To send SOAP headers in BPEL: 1. Define an SCA reference in the composite.xml to refer to the HeaderService. 2. Define the custom header variable, manipulate it, and send it using bpelx:inputHeaderVariable, as shown in Example 6–107 . Example 6–107 bpelx:inputHeaderVariable Use variables variable name=input messageType=tns:HeaderTestRequestMessage variable name=output messageType=tns:HeaderTestResultMessage variable name=request messageType=services:HeaderServiceRequestMessage variable name=response messageType=services:HeaderServiceResultMessage variable name=customHeadermessageType=services:CustomHeaderMessage variables ... -- initiate the remote process -- invoke name=invokeAsyncService partnerLink=HeaderService portType=services:HeaderService bpelx:inputHeaderVariable=customHeader operation=initiate inputVariable=request