7 Replies Latest reply on Nov 8, 2007 5:46 AM by zazzaz

    Is it possible to set a new URI for a partnerLink during pro

    zazzaz

      Hi,
      I have a problem. I'm wondering if it is possible to replace the URI that is read in the URICatalog can be set by an assign activity during th process execution, i.e. if an address read from a message can be set as URI for a partnerlink.

      Bye.


      ZazzaZ

        • 1. Re: Is it possible to set a new URI for a partnerLink during
          aguizar

          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:
          wsa http://schemas.xmlsoap.org/ws/2004/08/addressing
          wsdl http://schemas.xmlsoap.org/wsdl/
          bpel http://schemas.xmlsoap.org/ws/2004/03/business-process/

          • 2. Re: Is it possible to set a new URI for a partnerLink during
            zazzaz

            Ok

            but how the endpoint reference has to be initialized?
            I mean I declare a variable



            and before executing an assign activity like



            <from ep>




            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

            ZazzaZ

            • 3. Re: Is it possible to set a new URI for a partnerLink during
              zazzaz

               

              
              <variable name="ep" element="wsa:EndpointReference">
              
              <assign>
               <copy>
               <from variable="ep">
               <to partnerLink="pl">
               </copy>
              </assign>
              
              


              • 4. Re: Is it possible to set a new URI for a partnerLink during
                zazzaz

                Hi,
                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

                ZazzaZ

                • 5. Re: Is it possible to set a new URI for a partnerLink during
                  zazzaz

                  The correct namespace are specified in wsa:endpointReference tag as attributes (to make it recognizable by some factory)

                  They are

                  xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/"
                  xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/03/business-process/'


                  Nothing works. Bye

                  • 6. Re: Is it possible to set a new URI for a partnerLink during
                    aguizar

                    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.

                    • 7. Re: Is it possible to set a new URI for a partnerLink during
                      zazzaz

                      Ok,
                      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

                      ZazzaZ