5 Replies Latest reply on Dec 22, 2009 6:00 AM by Danny Kruitbosch

    Send message to external webservice

    Danny Kruitbosch Newbie



      I'm having trouble figuring out how to create a camel route (without using fuse esb) that reads an xml message from a jms queue, transforms it and sends the transformed message to a external webservice. It seems that this can only be done by doing some code generation from the wsdl.

      Is there any way to do this without code generation? More like the cxf-bc consumer in fuse esb. The transformation generates the correct soap body. I just need some component to stick it into a soap envelope and send it on to the service. (sort of a dynamic soap client?)

      My goal is to make use of FID with the least possible 'coding/code generation', just want to create and configure the eip diagrams.


      Thanks in advance,




      Edited by: dkruitbosch on Dec 10, 2009 4:56 PM

        • 1. Re: Send message to external webservice
          sriram_imshriram Novice

          I am a novice camel rider just like you, let me try to answer your question as much as i can.

          Use http://camel.apache.org/jms.html to know how to read messages from a queue. You could transform it by usind the http://camel.apache.org/xslt.html and the transfomred messages could be sent to any URL by using a simple


          This doesnt need any stub generation at all. (This is one of the finest things i like in camel )

          Make sure to add the corresponding camel components in your pom.


          Edited by: sriram on Dec 11, 2009 12:07 AM

          • 2. Re: Send message to external webservice
            Danny Kruitbosch Newbie

            I've looked at your points, but this doesn't solve my issue, since the XML I receive from jms is just XML, but the webservice I'm sending it of to, requires a SOAP message. The transform of the XML could be used to "generate" a full soap message, but I think that not the way to do it. I'd preferably have some component handling the soap stuff form me, and that I only have to concentrate on the payload. This is especially true when you need webservices features like IN ONLY messages, WS-* thinks etc.


            This is what the CXF-bc in the FUSE ESB gives me.





            • 3. Re: Send message to external webservice
              sriram_imshriram Novice

              From my knowledge of CAMEL, I dont think what you are asking is achievable using CAMEL. You may want to try something with SMX.

              Please read the specs in ServiceMix HTTP endpoint.

              Your Camel routes can dispatch the messages to SMX Http end points.

              • 4. Re: Send message to external webservice
                Lekan Omotayo Expert

                Yea. This can be done.


                Here is what it should look like:



                     <to uri="nmr:Service:ServiceSoap"/>    




                u nid 2 write a cxfbc:provider


                <cxfbc:provider wsdl="classpath:Service.wsdl"                 







                THis shld do.

                • 5. Re: Send message to external webservice
                  Danny Kruitbosch Newbie



                  So this still requires using smx. I'm not ready yet to start using a full ESB. I just want to have some simple integrations deployed directly in a webapp or in ActiveMQ. So in the current version routing messages to a web service is 'only' possible by generating at least an interface to the target service (the cxf codegen plugin will do that for me, I know).

                  I've been looking at camel 2.x and in PAYLOAD mode it does not require a serviceClass anymore for a SEI. You can just specify the wsdl, port and service in the cxf endpoint and you have a dynamic proxy!

                  So know it's just having to wait for the 'fuse' version of camel 2.x


                  Thanks for all your input!