Monday, February 11, 2013

How to make use of WS-Addressing ReplyTo header in an Asynchronus BPEL Process


In Apache ODE or WSO2 BPS, if you are looking for a way to asynchronously call back from a BPEL process, after the process is finished, to an reply address dynamically provided in the Request Message with WS-Addressing headers, you can copy the wsa:Address from the ReplyTo header, to the partnerLink related to the final invoke as follows:
<bpel:assign>
<bpel:copy>
<bpel:from header="ReplyTo" variable="initialRequest">
<bpel:query querylanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">wsa:Address/text()</bpel:query>
</bpel:from>
<bpel:to partnerlink="resultPartnerLink" />
</bpel:copy>
</bpel:assign>
view raw gistfile1.xml hosted with ❤ by GitHub
If you're testing this with SOAP UI, make sure you include wsa:Action, wsa:To, wsa:ReplyTo and MessageID in the request. Otherwise you will get an error similar to 'org.apache.axis2.AxisFault: A required header representing a Message Addressing Property is not present'
You can read more here about Using WS-Addressing in SOAP UI
Hat-tip: From Apache ODE mail archives, Related question from StackOverflow

No comments:

Post a Comment