Using WS Addressing in BPEL Partner Links

The fullWSAddressing partnerlink property is available in Oracle BPEL since 10.1.3.3. When set to true this property enables you to set the WS addressing properties From, Action, To, and FaultTo, through the deployment descriptor parameters. After enabling the partnerlink property i have not been able to find any change in the deployment descriptors or web.xml to utilize the WSA headers and had to search for an alternative solution. The Web Services Adressing 1.0 recommendation also describes the ReplyTo, MessageID, RelatesTo, RelatesTo/@RelationshipType messaging addressing properties in addition to the previously mentioned headers, which are not made available through the fullWSAddressing partnerlink property. You can however make use of all WS Addressing properties when calling external webservices through a BPEL Partner Link. I will explain in a few steps how to build a BPEL process making use of WS Addressing without usage of the fullWSAddressing partnerlink property.

Create a partnerlink
Create a new partnerlink, e.g. WSAEnabledPL, and use the wsdl of the external webservice as the WSDL File on the general page. After selecting Apply, you will be asked if a new WSDL may be created that contains Partner Link Types. Select Yes and a new wsdl file, with the name of the partnerlink, will be created in your project. Finish your new partnerlink creation by selecting the Partner Link Type and Role.

Add WS-A XSD import to partnerlink WSDL
Now add the Web Services Addressing schema to the created wsdl by opening the created wsdl-file (WSAEnabledPL.wsdl) and adding the following xml.

    <types>
        <xsd:schema targetNamespace="http://tempuri.org/Imports">
        <xsd:import namespace="http://www.w3.org/2005/08/addressing"
            schemaLocation="http://www.w3.org/2006/03/addressing/ws-addr.xsd"/>
        </xsd:schema>
    </types>

Create partnerlink Invoke
Create or modify a BPEL Invoke activity using the newly created partnerlink.

Create scope variables
Now create a scope variable of Type Element for each WS-Addressing property you need to set. Give the variables a clearly distinctable name, e.g. l_wsaTo or l_wsaAction, and assign the corresponding element to to variable. The corresponding element can be found by browsing the elements using the Type Explorer, through the path Project WSDL Files/{created WSDL}/Inline Schemas/xsd:schema.

Create Assign activity
Create an assign activity to assign the values to the scope variables containing the WS-Addressing properties.

Set Invoke Input Header Variable
Now open the source of your BPEL proces and locate the invoke of your partnerlink. If already defined in the Invoke, you can change the header variable by modifying the bpelx:inputHeaderVariable attribute. Otherwise you can add the attribute yourself as in the example below. Add the scope variables delimited by a space to the bpelx:inputHeaderVariable.

    <scope name="Scope_1">
        <variables>
            <variable name="l_wsaTo" element="ns19:To"/>
            <variable name="l_wsaAction" element="ns19:Action"/>
        </variables>
        <invoke name="WSAEnabledInvoke" partnerLink="WSAEnabledPL"
            portType="ns12:IExternalService"
            operation="UpdateOperation"
            inputVariable="WSAEnabledInvoke_UpdateOperation_InputVariable"
            outputVariable="WSAEnabledInvoke_ UpdateOperation _OutputVariable"
            bpelx:inputHeaderVariable="l_wsaTo l_wsaAction"/>
    </scope>


blog comments powered by Disqus