Wednesday 15 July 2020

Receive and send WSA Properties in BPEL 2.0

Last week I had the honour to present on CorrelationSets in a Virtual Meetup, which is a feature that relates to the WS-Addressing support of SOA Suite.

At my current customer, I had to rebuild a BPEL Process from 1.1 to 2.0, to be able to split it up using embedded and reusable  subprocesses.

One requitement is to receive the wsa-Action property and reply it back, concatenated with 'Response'.

Since it implements a WSDL with 3 operations, I need a Pick-OnMessage construction.

To receive properties you can open the activity, in my case the OnMessage:
In the source his looks like the following:
<onMessage partnerLink="MyService_WS" portType="ns1:myService" operation="myOperation"
          <bpelx:fromProperty name="wsa.action" variable="wsaAction"/>
With the wsaAction variable here is based on xsd:string.

However, this turns out not to work: the wsaAction variable stays empty.
This turns out to be a bug, that should have been solved since, but apparently still works as is. Read more about it in support document 1345071.1.

Solution is simple: just remove the wsa. prefix:
<onMessage partnerLink="MyService_WS" portType="ns1:myService" operation="myOperation"
          <bpelx:fromProperty name="action" variable="wsaAction"/>
For invoke, reply, receive and other activities it works the same.

As said, in my case I need to reply with a wsa.action that is a concatenation of the received action with 'Response'. This can be done using an expression:
Again, first choose wsa.action and then in the source remove the wsa. prefix:
<reply name="ReplyMyService" partnerLink="MyService_WS" portType="ns1:myService"
                 variable="MyService_OutputVariable" operation="myOperation">
              <bpelx:toProperty name="action">concat($wsaAction, 'Response')</bpelx:toProperty>
            <bpelx:property name="action" variable="WSAction"/>
Testing this in SoapUI or ReadyAPI will show:
<env:Envelope xmlns:env="" xmlns:wsa="">

For more info on setting properties, see the docs.