You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Paweł Wesołowski <pa...@softwaremind.pl> on 2010/07/13 14:10:30 UTC

problem with camel and cxf endpoint

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

Re: problem with camel and cxf endpoint

Posted by Paweł Wesołowski <pa...@softwaremind.pl>.
I forgot to add that I'm using camel in version 2.2.0.fuse-01-00.

W dniu 07/13/2010 02:10 PM, Paweł Wesołowski writes:
> 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
>


-- 
Software Mind 	

*Paweł Wesołowski*
Software Engineer
*Software Mind S.A.*
ul. Bociana 22A
31-231 Krakow
Poland

	Tel. +48 12 252 34 00
Fax: +48 12 252 34 01
pawel.wesolowski@softwaremind.pl <ma...@softwaremind.pl>
www.softwaremind.pl <http://www.softwaremind.pl>

This email may contain confidential and privileged material for the sole 
use of the intended recipient(s). Any review, use, retention, 
distribution or disclosure by others is strictly prohibited. If you are 
not the intended recipient (or authorized to receive for the recipient), 
please contact the sender by reply email and delete all copies of this 
message. Also, email is susceptible to data corruption, interception, 
tampering, unauthorized amendment and viruses. We only send and receive 
emails on the basis that we are not liable for any such corruption, 
interception, tampering, amendment or viruses or any consequence thereof.
<http://www.softwaremind.pl/en/Main_Page>


Re: problem with camel and cxf endpoint

Posted by Willem Jiang <wi...@gmail.com>.
It depends on what you want to do.
You can use the SOAPHandler, CXF interceptor to intercept the message. 
and you can totally change the soap message body by using tranformation 
which is provide by camel-xslt[1].

[1]http://camel.apache.org/xslt.html

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,
> 
> Really thanks for your reply.
> 
> I have one more question. Is there other way to intercept the soap 
> message (not using the Provider API) just to be able to send it through 
> cxf endpoint?
> 
> -- 
> Paweł Wesołowski
> 

Re: problem with camel and cxf endpoint

Posted by Paweł Wesołowski <pa...@softwaremind.pl>.
Hi,

Really thanks for your reply.

I have one more question. Is there other way to intercept the soap 
message (not using the Provider API) just to be able to send it through 
cxf endpoint?

--
Paweł Wesołowski

W dniu 07/13/2010 02:41 PM, Willem Jiang pisze:
> 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
>>
>
>


Re: problem with camel and cxf endpoint

Posted by Willem Jiang <wi...@gmail.com>.
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
>