8 Replies Latest reply on Aug 30, 2010 9:17 PM by njiang

    cxfEndpoint camel routing

    rkozura

      Hello.  I am trying to make a route inside FUSE Servicemix.

       

      I was wondering how to make a generic camel cxfEndpoint consumer that routes messages based on the operations in the SOAP message.  My web service is developed using JAX-WS annotations.

       

      Thank you for your help!

       

        • 1. Re: cxfEndpoint camel routing
          njiang

          It depends on how generic the route could be.

          If you just have one SEI, you can use it to setup the route for cxfEndpoint.

          If you have bunch of SEIs, then you may consider to use WebServiceProvider API, then you can route the SOAP message that you want.

          You can find more information about it here[1]

           

          http://camel.apache.org/cxf-example.html#CXFExample-CXFexampleforusingtheWebServiceProviderAPI

           

          Willem

          • 2. Re: cxfEndpoint camel routing
            rkozura

            The idea is to have a cxfEndpoint that routes messages to other cxfEndpoints.  So there will be multiple SEIs.

             

            I tried out that link and it works using @WebServiceProvider().  However, when I try and route to another cxfEndpoint I get the following fault:

             

            for RouterService#invoke has thrown exception, unwinding now

            org.apache.cxf.interceptor.Fault: BindingOperationInfo must be specified

             

             

            Any ideas how to fix this would be appreciated!

            • 3. Re: cxfEndpoint camel routing
              njiang

              Oh, you want route the request to another CXF Endpoint which has different SEI.

              The WebServiceProvider can't help you as current camel-cxf doesn't provide Dispatch API for you to use.

               

              BTW, did you do some transformation on the incoming SOAP message ?

               

              Maybe you can consider to use Camel-Jetty Component to take the SOAP request and do some transformation then route it to another endpoint.

               

              Willem

              • 4. Re: cxfEndpoint camel routing
                rkozura

                Is there any way to transform the message after the first cxfEndpoint to add the BindingOperationInfo?  This is the ultimate problem I am facing now.

                 

                 

                I tried using Jetty and there are two problems:

                 

                1.  The request goes through, the message is routing, beautiful!  However...the response header from Jetty seems to be unable to exceed 4k bytes:

                 

                java.lang.ArrayIndexOutOfBoundsException: 4096

                 

                2.  My co-workers seem to feel that Jetty is not integrated enough into FUSE ESB.  They want me to focus on cxf webservices, not web servers.

                 

                I am doing a "transformation" to the message, but nothing more than simple routing in-between a bean.

                 

                 

                Thank you SO much for your help so far

                 

                Edited by: rkozura on Aug 30, 2010 1:59 AM

                • 5. Re: cxfEndpoint camel routing
                  ffang

                  Hi,

                   

                  Which smx/camel version are you using?

                   

                  I believe response header from Jetty  exceed 4k issue has already been fixed,  CAMEL-2566[1] tracked this issue

                   

                  https://issues.apache.org/activemq/browse/CAMEL-2566

                   

                  Freeman

                  • 6. Re: cxfEndpoint camel routing
                    rkozura

                    The camel version I am using is 2.2.0.  So it seems the fixed version is 2.3.0?

                     

                    My next question is:  How do I update camel?  There are two version from what I can tell:

                     

                    1.  The "features" version of camel.

                     

                    2.  The version of camel that is inside of my repository.

                     

                    Unless they are the same

                    • 7. Re: cxfEndpoint camel routing
                      njiang

                      If your FuseESB can download artifacts from internet, I think update the feature file should be fine, but you need to make sure you don't install other version of camel.

                      Otherwise, you need to put the camel 2.3.0 into your mvn repository.

                      • 8. Re: cxfEndpoint camel routing
                        njiang

                        Just answering your question2.

                         

                        By using jetty can make you focus on the underlay stream, as you want to provides a generic web service proxy. You just need to transform the request to what you want, it could be easy if you are using the camel-xslt component, and CXF will not help you more unless you have some advance WS* requirement such WS addressing etc.

                         

                        Willem