camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: problem with camel and cxf endpoint
Date Tue, 13 Jul 2010 12:41:39 GMT
Hi,

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.

Willem
----------------------------------
Apache Camel, Apache CXF committer
Open SOA http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang

Paweł Wesołowski wrote:
> Hi all,
> 
> I have a problem with following flow:
> 
> 1. receive soap message
> 2. route the unchanged message
> 3. send soap message to remote webservice (this is external service and 
> I have only its wsdl file)
> 
> Here is my flow described in xml configuration:
> 
> ------------------------------------------------------------------------
> XML CONFIGURATION
> ------------------------------------------------------------------------
> <cxf:cxfEndpoint id="soapMessageEndpoint"
> serviceClass="pl.swmind.camel.soap.SOAPMessageProvider" 
> address="http://localhost:9000/soaprouter">
> </cxf:cxfEndpoint>
> 
> <cxf:cxfEndpoint id="testEndpoint"
> address="http://localhost:9001/customerservice" 
> endpointName="s:CustomerServicePort"
> serviceName="s:CustomerServiceService" 
> xmlns:s="http://customerservice.example.com/"
> wsdlURL="path/to/CustomerService.wsdl">
> 
> <cxf:properties>
> <entry key="dataFormat" value="MESSAGE" />
> </cxf:properties>
> </cxf:cxfEndpoint>
> 
> <camelContext id="test_context" 
> xmlns="http://camel.apache.org/schema/spring">
> <route>
> 
>    <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<SOAPMessage> {
> 
> 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 
> {http://soap.camel.swmind.pl/}SOAPMessageProviderService#{http://soap.camel.swmind.pl/}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?
> 
> -- 
> Paweł Wesołowski
> 


Mime
View raw message