Tuesday, 19 September 2017

Interact directly with Salesforce API using the Enterprise WSDL in BPEL 2.0

In my previous tutorial, I discussed the way to interact directly with Salesforce API using the Enterprise WSDL. The BPEL in the tutorial was in 1.1 version.

When I try to implement the same in BPEL version 2.0, it does not work. BPEl fault ‘fromvalue is not a sref:service-ref element’ is thrown at runtime. 



This error is related to PartnerReference variable (of enpointReference type ) which is directly assigned to the partner link. Though rest of the steps and logic remains the same,changes are only required for PartnerReference variable. Below are few changes related to this variable when trying to implement the same in BPEL 2.0

     1)  Download the ws-bpel_serviceref.xsd  and add it to your project

2) Create a variable PartnerReference of element type service-ref , which is defined in the above xsd.



3) Using append xml fragment option the following xml snippet to the above variable  PartnerReference

 <wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing">
    <wsa:Address/>
</wsa:EndpointReference>

Make sure to declare xmlns:wsa=http://schemas.xmlsoap.org/ws/2003/03/addressing namespace in BPEL as well.

4) Now assign  the server url received as a response of login operation to, PartnerReference/ wsa:EndpointReference/ wsa:Address


5) Now assign PartnerReference variable to the partner link that is to be invoked.



HAPPY LEARNING!!!!

1 comment:

Demystifying getActiveUnitofWork property of DB Adpater

Here in this I am going to discuss one of the interaction options available in Database adapter configuration, getActiveUnitofWork The p...