Per the BPEL specification, only the partner role of a partner link can be assigned a new address dynamically. Try the following:
<assign> <copy> <from variable="msg" part="reference"> <to partnerLink="pl"> </copy> </assign>
The information item returned by from must have a supported service reference type. Currently, the product supports wsa:EndpointReferenceType and wsdl:tService. If you have a BPEL 2 process, the type can also be bpel:ServiceRefType. The namespace URIs for these prefixes are:
but how the endpoint reference has to be initialized?
I mean I declare a variable
and before executing an assign activity like
I need to set something for the endpoint reference, isnt' it?
By the by, wsa:EndpointReferenceType and wsa:EndpointReference differs?
Thanks a lot for your time and availability. Bye
<variable name="ep" element="wsa:EndpointReference"> <assign> <copy> <from variable="ep"> <to partnerLink="pl"> </copy> </assign>
I tried using BPEL 2 and it didn't work out.
The only one accepted was
<copy> <from> <literal> <wsa:EndpointReference> <wsa:Address>THE_URI_FROM_THE_SERVICE_IN_THE_WSDL</wsa:Address> <wsa:ServiceName PortName="myPort">THE_SERVICENAME_FROM_THE_WSDL</wsa:ServiceName> </wsa:EndpointReference> </literal> </from> <to partnerLink="myPL"> </copy>
Ideally, the partnerLink should be OK. I saw the implementation of EndpointReference in endpointref package and no additional info is required.
The assignment goes fine but the invoke fails and the reason is that no port implements the required port type. Moreover it look like the process tries to build a new partnerlink loking the wsdl files in the URI catalog.
Hope anyone has a solution. Bye
The correct namespace are specified in wsa:endpointReference tag as attributes (to make it recognizable by some factory)
Nothing works. Bye
The information contained in the endpoint reference is used to identify the partner endpoint to invoke. However, it does not provide enough information to format a message (wsdl:binding) and send it to a given address (wsdl:port). The full WSDL description is still needed even if you set the reference dynamically.
The solution is to register the WSDL documents of all your candidate partner services. jBPM BPEL will select the best match to your endpoint reference among all the services in the catalog.
here is the code for full working.
//in variables <variable name="er" element="wsa:EndpointReference" /> <assign> <copy> <from> <wsa:EndpointReference xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" > <wsa:Address >URI_YOU_READ_IN_SERVICE_soap:address</wsa:Address> <wsa:Service >THE_NAME_OF_THE_SERVICE</wsa:Service> </wsa:EndpointReference> </from> <to variable="er" /> </copy> <copy> <from variable="er" /> <to partnerLink="ca"/> </copy> </assign>
You were right. I changed the URI in the WSDL with a wrong path and the tool read infos from the code I wrote in the assign.
Thanks a lot. If you need the full example, I can zip it and give you. Bye