4 Replies Latest reply on Jul 13, 2010 10:52 AM by wesoly

    problem with camel and cxf endpoint

    wesoly

      Hi all,

       

      I have a problem with following flow:

       

      1. receive soap message

      2. send soap message to remote webservice (this service is not deployed in fuse and I have only its wsdl file)

       

      Here is my flow described in xml configuration:

       

      -


      XML CONFIGURATION -


       

      <from uri="cxf:bean:soapMessageEndpoint" />

      <to uri="cxf:bean:testEndpoint" />

      </route>

      </camelContext>

      -


      XML CONFIGURATION -


       

      Class SOAPMessageProvider is very simple and was copied from example:

       

      @WebServiceProvider()

      @ServiceMode(Mode.MESSAGE)

      public class SOAPMessageProvider implements Provider&lt;SOAPMessage&gt; {

       

      public SOAPMessage invoke(SOAPMessage arg0) {

      // Requests should not come here as the Camel route will

      // intercept the call before this is invoked.

       

      throw new UnsupportedOperationException("Placeholder method");

      }

       

      }

       

      As you can see this is very simple flow and every time I sent a soap request I receive following exception:

       

      Interceptor for SOAPMessageProviderService#invoke has thrown exception, unwinding now

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

      at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:101)

      at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)

      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

      at java.util.concurrent.FutureTask.run(FutureTask.java:138)

      at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

      at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)

      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)

      at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)

      at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)

      at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)

      at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)

      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)

      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)

      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

      at org.mortbay.jetty.Server.handle(Server.java:326)

      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)

      at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)

      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)

      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)

      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)

      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

      Caused by: java.lang.IllegalArgumentException: BindingOperationInfo must be specified

      at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:244)

      at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:114)

      at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:97)

      at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:95)

      at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146)

      at org.apache.camel.processor.SendProcessor.doProcess(SendProcessor.java:94)

      at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:82)

      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)

      at org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:53)

      at org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:82)

      at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:93)

      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)

      at org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:177)

      at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:143)

      at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:88)

      at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49)

      at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:228)

      at org.apache.camel.processor.Pipeline.process(Pipeline.java:74)

      at org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:66)

      at org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)

      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:67)

      at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:91)

      ... 22 more

       

      Does anyone know how to solve this problem?

       

      Version of fuse esb used by me: 4.2.0-fuse-01-00

      Version of camel: 2.2.0.fuse-01-00

       

      Edited by: wesoly on Jul 12, 2010 6:54 PM

       

      Edited by: wesoly on Jul 12, 2010 6:54 PM

       

      Edited by: wesoly on Jul 12, 2010 6:55 PM

       

      Edited by: wesoly on Jul 12, 2010 6:57 PM

        • 1. Re: problem with camel and cxf endpoint
          davsclaus

          When sending to the remote webservice does it have multiple operations? eg are the more than 1 possible operation to invoke?

           

          You may have to specify which operation to invoke by setting a header.

           

           

           

          There are some details here http://camel.apache.org/cxf.

          • 2. Re: problem with camel and cxf endpoint
            wesoly

            Yes, interface has two methods, which can be invoked. I have specified the information about the method to invoke, but the result was the same.

             

            Moreover, I don't understand, why I should do that, I just want to intercept soap message and route it to external service, without analyzing its content.

            • 3. Re: problem with camel and cxf endpoint
              davsclaus

              Also posted on Camel mailinglist and answered.

              • 4. Re: problem with camel and cxf endpoint
                wesoly

                Problem solved. Here is explanation:

                 

                Willem Jiang wrote:

                You are using the Provider API on the soapMessageEndpoint endpoint, which doesn't set the BindingOperationInfo.

                 

                You just the get the SOAPMessage from the soapMessageEndpoint, if you want to send it to the other client without changing it, you could write this SOAPMessage into a stream and use camel-http endpoint send out the request.

                 

                The testEndpoint with the MESSAGE dataformat can't reuse the this SOAPMessage.