2 Replies Latest reply on May 6, 2010 1:18 PM by Fernando Salceda

    http destination uri

    Fernando Salceda Novice

      I'm improving my example setting the locationURI that is going to call the provider with a "org.apache.servicemix.http.destination.uri" header, but I would like to do it in a particular way. The message contains a parameter with the locationUri. At the moment I have the following scenario in my router that calls the final cxf-provider:

       

                      

                               <to uri="jbi:service:http://toplus.examples.andago.com/ToPlus-Service?operation=toPlus"/>

                                 

       

       

      I would like to keep the locationUri from the message in a variable and then set the header with the value of the variable instead of using a constant. I think I have to do something like that because I have a xslt tranformation below that removes the original locationURI value and I also think that I have to set the header just before I call the cxf-provider, or is it not so?

       

      How can I manage it? Is there any easier way to do that?

        • 1. Re: http destination uri
          Fernando Salceda Novice

          I resolved my problem moving the set header tag before transformation, but now when I try to get the destination uri from the body message it doesn't work:

           

                               

                                   <to uri="jbi:service:http://toplus.examples.andago.com/ToPlus-Service?operation=toPlus"/>

                                     

           

          When I put a different constant value and restart the provider component that receives the header (destination uri) the provider works fine and calls the right service. I restart the provider because of the bug that doesn't dynamically actualize the locationURI and hoping that you will soon fix it in a future release.

           

          But when I try with xpath to get the header from the body message (I checked that the xsd:bolocation element is present and correct), the provider use the default service address established in the wsdl. What I want is actually to get the providers  locationURI from a parameter that is included in the request message.

           

          I'm pretty sure that I'm doing someting wrong getting the "xsd:bolocation" value because the routing with "xsd:operation" works fine.

           

          I would appreciate any help, please.

           

          Regards.

          • 2. Re: http destination uri
            Fernando Salceda Novice

            I found out what was wrong... I had to add the resultType attribute as it follows: