Tuesday, October 23, 2018

Dynamic Partnerlink in BPEL | SOA

How to setup dynamic partnerlink in BPEL. This is used to override the targetsystem URL in the run time. The URL can be stored in AIAConfigurationProperties.xml or variable or URL can be received as input too.

  • Create two variables(TargetEndpointLocation & EndpointReference) as shown below.

For variable "EndpointReference", you can download the schema from below url.

  • Then create an Assign activity with 3 copy actions. Assuming "TargetEndpointLocation" variable already have the Address URL.


Source Code for this assign:
<assign name="AssignPartnerlinkEndpointReference">
<copy>
<from>
<wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
<wsa:Address/>
</wsa:EndpointReference>
</from>
<to variable="EndpointReference"/>
</copy>
<copy>
<from variable="TargetEndpointLocation"/>
<to variable="EndpointReference"
                query="/wsa:EndpointReference/wsa:Address"/>
</copy>
<copy>
<from variable="EndpointReference"/>
<to partnerLink="OrderManagementOSM"/>
</copy>
</assign>

Note: If you are using AIA, you can use the below java code to retrieve the URL from AIAConfigurationProperties.xml