3 Replies Latest reply on May 7, 2008 4:27 AM by Torsten Mielke

    ServiceMix Web Service BC?

    Roger Joelsson Novice

      Hi all,


      Could anyone help me in this -- hopefully -- simple matter?


      Task: I want to have a Binding Component on the ESB that upon receiving messages from the NMR, performs a Web Service call (using the data received from the NMR), and finally puts the response (after being normalized) to the NMR again.


      Proposed solution: I have a component (actually an Apache Camel SE) on the bus. This component routes the message (actually an XML document) to the a Web Service outbound BC. The idea (as I see it) is that the BC should perform the appropriate Web Service call (i.e. first by de-serializing the message), and then, as the response arrives, normalize (i.e. create a new XML document) the response and send it back to some destination on the NMR.


      After some studies, I, though, cannot find any suitable components for doing this. Can anyone guide me on what component(s) I should use? The servicemix-cxf-bc is able to do the Web Service calls, but how/where do I specify can WS operation call(s) that should be done? Perhaps do I have to create my own BC?


      Last note: I'm using Java 6, i.e. I'm having the built-in JAX-WS implementation. Will that help me in any way?



      Roger Joelsson

        • 1. Re: ServiceMix Web Service BC?
          Torsten Mielke Apprentice

          Not sure what format your original XML document is in but you need to construct a valid SOAP message somehow. This might require some XML transformation or utilizing a servicemix-bean class. Thereafter you can simply route the message to your CXF BC provider component that is configured to invoke on the external web service.

          The WS operation name is determined from your SOAP request (it is basically the first element on the message payload).

          • 2. Re: ServiceMix Web Service BC?
            Roger Joelsson Novice

            Hi again,


            Thanks for your prompt reply!


            If I understand you correctly, what we have to do is to manually create the Web Service call wrapped inside a SOAP envelope (preferably in my Apache Camel RouterBuilder descendant?) and then route that to the CXF BC which will do the transport for me? It sure solves the task, though feelsa bit cumbersome, especially when there is JAX-WS bundled with JSE 6 these days. Anyhow, can you confirm that this is the way to go, and do you have any hints if using JSE 6 JAX-WS as a "helper" would be a good idea?




            • 3. Re: ServiceMix Web Service BC?
              Torsten Mielke Apprentice

              I was assuming the message that comes into your Camel route is of very similar structure to the message you need to send out to the external system. In that case you might only need some basic XSLT transformation between the two message formats.

              If the interfaces differ a lot, then you might rather want to use a CXF Proxy for the outgoing call (see section Proxy on the link provided). You can use a CXF Proxy from inside a servicemix-bean or servicemix-cxf-se component.

              I am not sure if Java 6 JAX-WS support can help you and leave that for someone else to answer.