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.
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>
<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!!!!
It 's an amazing and awesome blog. Thanks for sharing
ReplyDeleteSOA Training in Hyderabad
SOA Online Training