Calling external webservice using cxf camel endpoint

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling external webservice using cxf camel endpoint

unmarshall
Hi All,

I am using Camel 2.4 and cxf 2.2.11 for a prototype that i am developing at
present.
I have created a bunch of JAX-WS webservices and they are hosted on my local
tomcat installation.

I am trying to configure a CXF endpoint in Camel which will bind to the
external webservice and post the soap request message to it. Following is
the Spring CXF configuration:

*<!-- CXF consumer endpoint - This will be the entry point.  -->*
<!--
---------------------------------------------------------------------------------------------------
-->
    <cxf:cxfEndpoint
        id="endpoint1"
        address="/sales"
        wsdlURL="sales.wsdl"
        endpointName="ns0:HTTP_Port"
        serviceName="ns0:SalesService">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
            <entry key="setDefaultBus" value="true"/>
        </cxf:properties>
    </cxf:cxfEndpoint>

*<!-- This is the externally hosted webservice -->*
<!--
---------------------------------------------------------------------------------------------------
-->
    <cxf:cxfEndpoint
        id="endpoint2"
        address="http://localhost:8080/jaxws-demows/SalesOrder"
        wsdlURL="http://localhost:8080/jaxws-demows/SalesOrder?wsdl"
        serviceName="ns2:SalesOrderService"
        endpointName="ns2:SalesOrderPort">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
        </cxf:properties>
    </cxf:cxfEndpoint>


*<!-- camel route -->*
<!--
---------------------------------------------------------------------------------------------------
-->
<camel:camelContext trace="true"
id="pipeline.example.camel-examples-cxf-composite-enrich">
<camel:route>
            <camel:from uri="cxf:bean:endpoint1"/>
            <camel:convertBodyTo type="java.lang.String" />
            <camel:to uri="xslt:convertForEndpoint2.xslt"/>
            <camel:to uri="cxf:bean:endpoint2"/>
            <camel:to uri="file:/c:/tmp?fileName=result.xml" />
 </camel:route>
</camel:camelContext>

For the external webservice represented by endpoint2 i only have one
operation defined so ideally i do not have to specify the operationName and
operationNamespace explicitly. When i submit a soap request using SOAP UI
then the first 3 endpoints in the above route run just fine, the response
from the first endpoint (consumer) is then converted to request for endpoint
2 using xslt endpoint successfully. However when the 4th endpoint in the
route (external webservice) is invoked then the following exception is
thrown:

org.apache.cxf.interceptor.Fault: BindingOperationInfo must be specified
        at
org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer.java:123)
~[na:na]
        at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:102)
~[na:na]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) ~[na:1.6.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
~[na:1.6.0_21]
        at java.util.concurrent.FutureTask.run(Unknown Source)
~[na:1.6.0_21]
        at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java:80)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invokeDestination(OsgiServletController.java:321)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invoke(OsgiServletController.java:145)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java:53)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java:48)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
~[org.apache.geronimo.specs.geronimo-servlet_2.5_spec-1.1.1.jar:1.1.1]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64)
~[na:na]
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.handle(HttpServiceContext.java:111)
~[na:na]
        at
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:64)
~[na:na]
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.Server.handle(Server.java:322)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
~[na:na]
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
~[org.mortbay.jetty.jetty-util-6.1.23.jar:na]
Caused by: java.lang.IllegalArgumentException: BindingOperationInfo must be
specified
        at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:262)
~[na:na]
        at
org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:113)
~[na:na]
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
~[na:na]
        at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
~[na:na]
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:174)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290)
~[na:na]
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
~[na:na]
        at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
~[na:na]
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
~[na:na]
        at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:97)
~[na:na]


I also tried explicitly setting the header properties - operationName and
namespace so that it picks up the binding operation info but it does not. I
also tried directly using HTTP POST on Camel HTTP endpoint but that also
does not work - it throws a Http 500 error code.

Any pointers would be helpful here.

Best Regards,
Madhav

--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do
Reply | Threaded
Open this post in threaded view
|

AW: Calling external webservice using cxf camel endpoint

Schneider Christian
Hi,

it looks like you simply want to convert the xml you receive in the first service to xml that is suitable for the other service. I think in this case you should not use the cxf component. Instead you should route from a jetty endpoint that receives the request to a http endpoint that sends the converted request. If the service is request reply then you will also have to convert the response.


Best regards

Christian


Christian Schneider
Informationsverarbeitung
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


-----Ursprüngliche Nachricht-----
Von: Madhav Bhargava [mailto:[hidden email]]
Gesendet: Mittwoch, 27. Oktober 2010 11:03
An: [hidden email]
Betreff: Calling external webservice using cxf camel endpoint

Hi All,

I am using Camel 2.4 and cxf 2.2.11 for a prototype that i am developing at
present.
I have created a bunch of JAX-WS webservices and they are hosted on my local
tomcat installation.

I am trying to configure a CXF endpoint in Camel which will bind to the
external webservice and post the soap request message to it. Following is
the Spring CXF configuration:

*<!-- CXF consumer endpoint - This will be the entry point.  -->*
<!--
---------------------------------------------------------------------------------------------------
-->
    <cxf:cxfEndpoint
        id="endpoint1"
        address="/sales"
        wsdlURL="sales.wsdl"
        endpointName="ns0:HTTP_Port"
        serviceName="ns0:SalesService">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
            <entry key="setDefaultBus" value="true"/>
        </cxf:properties>
    </cxf:cxfEndpoint>

*<!-- This is the externally hosted webservice -->*
<!--
---------------------------------------------------------------------------------------------------
-->
    <cxf:cxfEndpoint
        id="endpoint2"
        address="http://localhost:8080/jaxws-demows/SalesOrder"
        wsdlURL="http://localhost:8080/jaxws-demows/SalesOrder?wsdl"
        serviceName="ns2:SalesOrderService"
        endpointName="ns2:SalesOrderPort">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
        </cxf:properties>
    </cxf:cxfEndpoint>


*<!-- camel route -->*
<!--
---------------------------------------------------------------------------------------------------
-->
<camel:camelContext trace="true"
id="pipeline.example.camel-examples-cxf-composite-enrich">
<camel:route>
            <camel:from uri="cxf:bean:endpoint1"/>
            <camel:convertBodyTo type="java.lang.String" />
            <camel:to uri="xslt:convertForEndpoint2.xslt"/>
            <camel:to uri="cxf:bean:endpoint2"/>
            <camel:to uri="file:/c:/tmp?fileName=result.xml" />
 </camel:route>
</camel:camelContext>

For the external webservice represented by endpoint2 i only have one
operation defined so ideally i do not have to specify the operationName and
operationNamespace explicitly. When i submit a soap request using SOAP UI
then the first 3 endpoints in the above route run just fine, the response
from the first endpoint (consumer) is then converted to request for endpoint
2 using xslt endpoint successfully. However when the 4th endpoint in the
route (external webservice) is invoked then the following exception is
thrown:

org.apache.cxf.interceptor.Fault: BindingOperationInfo must be specified
        at
org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer.java:123)
~[na:na]
        at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:102)
~[na:na]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) ~[na:1.6.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
~[na:1.6.0_21]
        at java.util.concurrent.FutureTask.run(Unknown Source)
~[na:1.6.0_21]
        at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java:80)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invokeDestination(OsgiServletController.java:321)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invoke(OsgiServletController.java:145)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java:53)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java:48)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
~[org.apache.geronimo.specs.geronimo-servlet_2.5_spec-1.1.1.jar:1.1.1]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64)
~[na:na]
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.handle(HttpServiceContext.java:111)
~[na:na]
        at
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:64)
~[na:na]
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.Server.handle(Server.java:322)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
~[na:na]
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
~[org.mortbay.jetty.jetty-util-6.1.23.jar:na]
Caused by: java.lang.IllegalArgumentException: BindingOperationInfo must be
specified
        at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:262)
~[na:na]
        at
org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:113)
~[na:na]
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
~[na:na]
        at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
~[na:na]
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:174)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290)
~[na:na]
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
~[na:na]
        at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
~[na:na]
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
~[na:na]
        at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:97)
~[na:na]


I also tried explicitly setting the header properties - operationName and
namespace so that it picks up the binding operation info but it does not. I
also tried directly using HTTP POST on Camel HTTP endpoint but that also
does not work - it throws a Http 500 error code.

Any pointers would be helpful here.

Best Regards,
Madhav

--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do
Reply | Threaded
Open this post in threaded view
|

Re: AW: Calling external webservice using cxf camel endpoint

unmarshall
Hi Christian,

Thanks for your response. I have already tried the following, i replaced the endpoint2 (which was pointing to the external webservice) with:

 <camel:setHeader headerName="CamelHttpMethod">
        <camel:constant>POST</camel:constant>
</camel:setHeader>
<camel:to uri="http://localhost:8080/jaxws-demows/SalesOrderItemByBuyerAndProductQuery"/>

To test if the starting endpoint was working fine i commented out the rest of the endpoints and only added a file endpoint. The starting endpoint (endpoint1) was working as expected. So i kept it as it is.

When i used Http endpoint for endpoint2 then i got the following error:

] Exception: org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8080/jaxws-demows/SalesOrderItemByBuyerAndProductQuery with statusCode: 500
15:18:25.370 WARN  [693106714@qtp-346216967-0 - /cxf/salesOrderDetailsForClaimsProcessing] o.a.cxf.phase.PhaseInterceptorChain [Slf4jLogger.java:92] - Interceptor for {http://www.example.com/cmservices}SalesOrderDetailsForClaimProcessingQueryResponse_In_SAService#{http://www.example.com/cmservices}ReadSalesOrderDetailsForClaimProcessing has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: HTTP operation failed invoking http://localhost:8080/jaxws-demows/SalesOrderItemByBuyerAndProductQuery with statusCode: 500
        at org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer.java:123) ~[na:na]
        at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:102) ~[na:na]
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.6.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.6.0_21]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.6.0_21]
        at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java:80) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.transport.http_osgi.OsgiServletController.invokeDestination(OsgiServletController.java:321) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.transport.http_osgi.OsgiServletController.invoke(OsgiServletController.java:145) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java:53) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java:48) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713) ~[org.apache.geronimo.specs.geronimo-servlet_2.5_spec-1.1.1.jar:1.1.1]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159) ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64) ~[na:na]
        at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.handle(HttpServiceContext.java:111) ~[na:na]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:64) ~[na:na]
        at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.Server.handle(Server.java:322) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) ~[na:na]
        at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) ~[org.mortbay.jetty.jetty-util-6.1.23.jar:na]
Caused by: org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking http://localhost:8080/jaxws-demows/SalesOrderItemByBuyerAndProductQuery with statusCode: 500
        at org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:157) ~[na:na]
        at org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:99) ~[na:na]
        at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50) ~[na:na]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) ~[na:na]
        at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104) ~[na:na]
        at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272) ~[na:na]
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98) ~[na:na]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) ~[na:na]
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) ~[na:na]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) ~[na:na]
        at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:174) ~[na:na]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) ~[na:na]
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) ~[na:na]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) ~[na:na]
        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290) ~[na:na]
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202) ~[na:na]
        at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256) ~[na:na]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) ~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:143) ~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:78) ~[na:na]
        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99) ~[na:na]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) ~[na:na]
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) ~[na:na]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91) ~[na:na]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85) ~[na:na]
        at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:97) ~[na:na]
        ... 33 common frames omitted

Am i doing something wrong here?

Thanks & Regards,
Madhav

Schneider Christian wrote
Hi,

it looks like you simply want to convert the xml you receive in the first service to xml that is suitable for the other service. I think in this case you should not use the cxf component. Instead you should route from a jetty endpoint that receives the request to a http endpoint that sends the converted request. If the service is request reply then you will also have to convert the response.


Best regards

Christian


Christian Schneider
Informationsverarbeitung
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


-----Ursprüngliche Nachricht-----
Von: Madhav Bhargava [mailto:unmarshall@gmail.com]
Gesendet: Mittwoch, 27. Oktober 2010 11:03
An: users@camel.apache.org
Betreff: Calling external webservice using cxf camel endpoint

Hi All,

I am using Camel 2.4 and cxf 2.2.11 for a prototype that i am developing at
present.
I have created a bunch of JAX-WS webservices and they are hosted on my local
tomcat installation.

I am trying to configure a CXF endpoint in Camel which will bind to the
external webservice and post the soap request message to it. Following is
the Spring CXF configuration:

**

    <cxf:cxfEndpoint
        id="endpoint1"
        address="/sales"
        wsdlURL="sales.wsdl"
        endpointName="ns0:HTTP_Port"
        serviceName="ns0:SalesService">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
            <entry key="setDefaultBus" value="true"/>
        </cxf:properties>
    </cxf:cxfEndpoint>

**

    <cxf:cxfEndpoint
        id="endpoint2"
        address="http://localhost:8080/jaxws-demows/SalesOrder"
        wsdlURL="http://localhost:8080/jaxws-demows/SalesOrder?wsdl"
        serviceName="ns2:SalesOrderService"
        endpointName="ns2:SalesOrderPort">
        <cxf:properties>
            <entry key="dataFormat" value="PAYLOAD"/>
        </cxf:properties>
    </cxf:cxfEndpoint>


**

<camel:camelContext trace="true"
id="pipeline.example.camel-examples-cxf-composite-enrich">
<camel:route>
            <camel:from uri="cxf:bean:endpoint1"/>
            <camel:convertBodyTo type="java.lang.String" />
            <camel:to uri="xslt:convertForEndpoint2.xslt"/>
            <camel:to uri="cxf:bean:endpoint2"/>
            <camel:to uri="file:/c:/tmp?fileName=result.xml" />
 </camel:route>
</camel:camelContext>

For the external webservice represented by endpoint2 i only have one
operation defined so ideally i do not have to specify the operationName and
operationNamespace explicitly. When i submit a soap request using SOAP UI
then the first 3 endpoints in the above route run just fine, the response
from the first endpoint (consumer) is then converted to request for endpoint
2 using xslt endpoint successfully. However when the 4th endpoint in the
route (external webservice) is invoked then the following exception is
thrown:

org.apache.cxf.interceptor.Fault: BindingOperationInfo must be specified
        at
org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer.java:123)
~[na:na]
        at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:102)
~[na:na]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) ~[na:1.6.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
~[na:1.6.0_21]
        at java.util.concurrent.FutureTask.run(Unknown Source)
~[na:1.6.0_21]
        at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java:80)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invokeDestination(OsgiServletController.java:321)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invoke(OsgiServletController.java:145)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java:53)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java:48)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
~[org.apache.geronimo.specs.geronimo-servlet_2.5_spec-1.1.1.jar:1.1.1]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64)
~[na:na]
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.handle(HttpServiceContext.java:111)
~[na:na]
        at
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:64)
~[na:na]
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.Server.handle(Server.java:322)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
~[na:na]
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
~[org.mortbay.jetty.jetty-util-6.1.23.jar:na]
Caused by: java.lang.IllegalArgumentException: BindingOperationInfo must be
specified
        at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:262)
~[na:na]
        at
org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:113)
~[na:na]
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
~[na:na]
        at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
~[na:na]
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:174)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290)
~[na:na]
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
~[na:na]
        at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
~[na:na]
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
~[na:na]
        at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:97)
~[na:na]


I also tried explicitly setting the header properties - operationName and
namespace so that it picks up the binding operation info but it does not. I
also tried directly using HTTP POST on Camel HTTP endpoint but that also
does not work - it throws a Http 500 error code.

Any pointers would be helpful here.

Best Regards,
Madhav

--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do
Reply | Threaded
Open this post in threaded view
|

AW: AW: Calling external webservice using cxf camel endpoint

Schneider Christian
Status code 500 means internal server error. I guess the endpoint you sent the request to was not able to process the request. Perhaps you will have more details in the log of this endpoint.

It could be some invalid soap for that service...

Best regards

Christian





Christian Schneider
Informationsverarbeitung
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier


-----Ursprüngliche Nachricht-----
Von: unmarshall [mailto:[hidden email]]
Gesendet: Mittwoch, 27. Oktober 2010 11:49
An: [hidden email]
Betreff: Re: AW: Calling external webservice using cxf camel endpoint


Hi Christian,

Thanks for your response. I have already tried the following, i replaced the
endpoint2 (which was pointing to the external webservice) with:

 <camel:setHeader headerName="CamelHttpMethod">
        <camel:constant>POST</camel:constant>
</camel:setHeader>
<camel:to
uri="http://localhost:8080/jaxws-demows/SalesOrderItemByBuyerAndProductQuery"/>

To test if the starting endpoint was working fine i commented out the rest
of the endpoints and only added a file endpoint. The starting endpoint
(endpoint1) was working as expected. So i kept it as it is.

When i used Http endpoint for endpoint2 then i got the following error:

] Exception: org.apache.camel.component.http.HttpOperationFailedException:
HTTP operation failed invoking
http://localhost:8080/jaxws-demows/SalesOrderItemByBuyerAndProductQuery with
statusCode: 500
15:18:25.370 WARN  [693106714@qtp-346216967-0 -
/cxf/salesOrderDetailsForClaimsProcessing]
o.a.cxf.phase.PhaseInterceptorChain [Slf4jLogger.java:92] - Interceptor for
{http://www.example.com/cmservices}SalesOrderDetailsForClaimProcessingQueryResponse_In_SAService#{http://www.example.com/cmservices}ReadSalesOrderDetailsForClaimProcessing
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: HTTP operation failed invoking
http://localhost:8080/jaxws-demows/SalesOrderItemByBuyerAndProductQuery with
statusCode: 500
        at
org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer.java:123)
~[na:na]
        at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:102)
~[na:na]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) ~[na:1.6.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
~[na:1.6.0_21]
        at java.util.concurrent.FutureTask.run(Unknown Source)
~[na:1.6.0_21]
        at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java:80)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invokeDestination(OsgiServletController.java:321)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServletController.invoke(OsgiServletController.java:145)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java:53)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java:48)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
~[org.apache.geronimo.specs.geronimo-servlet_2.5_spec-1.1.1.jar:1.1.1]
        at
org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64)
~[na:na]
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.handle(HttpServiceContext.java:111)
~[na:na]
        at
org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:64)
~[na:na]
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.Server.handle(Server.java:322)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
~[org.mortbay.jetty.jetty-6.1.23.jar:na]
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
~[na:na]
        at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
~[org.mortbay.jetty.jetty-util-6.1.23.jar:na]
Caused by: org.apache.camel.component.http.HttpOperationFailedException:
HTTP operation failed invoking
http://localhost:8080/jaxws-demows/SalesOrderItemByBuyerAndProductQuery with
statusCode: 500
        at
org.apache.camel.component.http.HttpProducer.populateHttpOperationFailedException(HttpProducer.java:157)
~[na:na]
        at
org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:99)
~[na:na]
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
~[na:na]
        at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
~[na:na]
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:174)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290)
~[na:na]
        at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
~[na:na]
        at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
~[na:na]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
~[na:na]
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
~[na:na]
        at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
~[na:na]
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
~[na:na]
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
~[na:na]
        at
org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:97)
~[na:na]
        ... 33 common frames omitted

Am i doing something wrong here?

Thanks & Regards,
Madhav


Schneider Christian wrote:

>
> Hi,
>
> it looks like you simply want to convert the xml you receive in the first
> service to xml that is suitable for the other service. I think in this
> case you should not use the cxf component. Instead you should route from a
> jetty endpoint that receives the request to a http endpoint that sends the
> converted request. If the service is request reply then you will also have
> to convert the response.
>
>
> Best regards
>
> Christian
>
>
> Christian Schneider
> Informationsverarbeitung
> Business Solutions
> Handel und Dispatching
>
> Tel : +49-(0)721-63-15482
>
> EnBW Systeme Infrastruktur Support GmbH
> Sitz der Gesellschaft: Karlsruhe
> Handelsregister: Amtsgericht Mannheim ­ HRB 108550
> Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
> Geschäftsführer: Jochen Adenau, Hans-Günther Meier
>
>
> -----Ursprüngliche Nachricht-----
> Von: Madhav Bhargava [mailto:[hidden email]]
> Gesendet: Mittwoch, 27. Oktober 2010 11:03
> An: [hidden email]
> Betreff: Calling external webservice using cxf camel endpoint
>
> Hi All,
>
> I am using Camel 2.4 and cxf 2.2.11 for a prototype that i am developing
> at
> present.
> I have created a bunch of JAX-WS webservices and they are hosted on my
> local
> tomcat installation.
>
> I am trying to configure a CXF endpoint in Camel which will bind to the
> external webservice and post the soap request message to it. Following is
> the Spring CXF configuration:
>
> *<!-- CXF consumer endpoint - This will be the entry point.  -->*
> <!--
> ---------------------------------------------------------------------------------------------------
> -->
>     <cxf:cxfEndpoint
>         id="endpoint1"
>         address="/sales"
>         wsdlURL="sales.wsdl"
>         endpointName="ns0:HTTP_Port"
>         serviceName="ns0:SalesService">
>         <cxf:properties>
>             <entry key="dataFormat" value="PAYLOAD"/>
>             <entry key="setDefaultBus" value="true"/>
>         </cxf:properties>
>     </cxf:cxfEndpoint>
>
> *<!-- This is the externally hosted webservice -->*
> <!--
> ---------------------------------------------------------------------------------------------------
> -->
>     <cxf:cxfEndpoint
>         id="endpoint2"
>         address="http://localhost:8080/jaxws-demows/SalesOrder"
>         wsdlURL="http://localhost:8080/jaxws-demows/SalesOrder?wsdl"
>         serviceName="ns2:SalesOrderService"
>         endpointName="ns2:SalesOrderPort">
>         <cxf:properties>
>             <entry key="dataFormat" value="PAYLOAD"/>
>         </cxf:properties>
>     </cxf:cxfEndpoint>
>
>
> *<!-- camel route -->*
> <!--
> ---------------------------------------------------------------------------------------------------
> -->
> <camel:camelContext trace="true"
> id="pipeline.example.camel-examples-cxf-composite-enrich">
> <camel:route>
>             <camel:from uri="cxf:bean:endpoint1"/>
>             <camel:convertBodyTo type="java.lang.String" />
>             <camel:to uri="xslt:convertForEndpoint2.xslt"/>
>             <camel:to uri="cxf:bean:endpoint2"/>
>             <camel:to uri="file:/c:/tmp?fileName=result.xml" />
>  </camel:route>
> </camel:camelContext>
>
> For the external webservice represented by endpoint2 i only have one
> operation defined so ideally i do not have to specify the operationName
> and
> operationNamespace explicitly. When i submit a soap request using SOAP UI
> then the first 3 endpoints in the above route run just fine, the response
> from the first endpoint (consumer) is then converted to request for
> endpoint
> 2 using xslt endpoint successfully. However when the 4th endpoint in the
> route (external webservice) is invoked then the following exception is
> thrown:
>
> org.apache.cxf.interceptor.Fault: BindingOperationInfo must be specified
>         at
> org.apache.camel.component.cxf.CxfConsumer$1.checkFailure(CxfConsumer.java:123)
> ~[na:na]
>         at
> org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:102)
> ~[na:na]
>         at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
> Source) ~[na:1.6.0_21]
>         at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
> ~[na:1.6.0_21]
>         at java.util.concurrent.FutureTask.run(Unknown Source)
> ~[na:1.6.0_21]
>         at
> org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.transport.http_osgi.OsgiDestination.doMessage(OsgiDestination.java:80)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.transport.http_osgi.OsgiServletController.invokeDestination(OsgiServletController.java:321)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.transport.http_osgi.OsgiServletController.invoke(OsgiServletController.java:145)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.transport.http_osgi.OsgiServlet.invoke(OsgiServlet.java:53)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.transport.http_osgi.SpringOsgiServlet.invoke(SpringOsgiServlet.java:48)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> ~[org.apache.geronimo.specs.geronimo-servlet_2.5_spec-1.1.1.jar:1.1.1]
>         at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
> ~[org.apache.cxf.cxf-bundle-2.2.11.jar:2.2.11]
>         at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.handle(HttpServiceServletHandler.java:64)
> ~[na:na]
>         at
> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.handle(HttpServiceContext.java:111)
> ~[na:na]
>         at
> org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:64)
> ~[na:na]
>         at
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at org.mortbay.jetty.Server.handle(Server.java:322)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> ~[org.mortbay.jetty.jetty-6.1.23.jar:na]
>         at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> ~[na:na]
>         at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> ~[org.mortbay.jetty.jetty-util-6.1.23.jar:na]
> Caused by: java.lang.IllegalArgumentException: BindingOperationInfo must
> be
> specified
>         at
> org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:262)
> ~[na:na]
>         at
> org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:113)
> ~[na:na]
>         at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
> ~[na:na]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
> ~[na:na]
>         at
> org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
> ~[na:na]
>         at
> org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
> ~[na:na]
>         at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
> ~[na:na]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> ~[na:na]
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> ~[na:na]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> ~[na:na]
>         at
> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:174)
> ~[na:na]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> ~[na:na]
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> ~[na:na]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
> ~[na:na]
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290)
> ~[na:na]
>         at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202)
> ~[na:na]
>         at
> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256)
> ~[na:na]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
> ~[na:na]
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:143)
> ~[na:na]
>         at org.apache.camel.processor.Pipeline.process(Pipeline.java:78)
> ~[na:na]
>         at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
> ~[na:na]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
> ~[na:na]
>         at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
> ~[na:na]
>         at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
> ~[na:na]
>         at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
> ~[na:na]
>         at
> org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:97)
> ~[na:na]
>
>
> I also tried explicitly setting the header properties - operationName and
> namespace so that it picks up the binding operation info but it does not.
> I
> also tried directly using HTTP POST on Camel HTTP endpoint but that also
> does not work - it throws a Http 500 error code.
>
> Any pointers would be helpful here.
>
> Best Regards,
> Madhav
>
> --
> When I tell the truth, it is not for the sake of convincing those who do
> not
> know it, but for the sake of defending those that do
>
>

--
View this message in context: http://camel.465427.n5.nabble.com/Calling-external-webservice-using-cxf-camel-endpoint-tp3238383p3238440.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: AW: AW: Calling external webservice using cxf camel endpoint

unmarshall
Hi Christian,

Thanks for your response. Camel Http component worked but that is not what we are looking for. Following are the reasons:

1. The routes are usually created by the clients and they range from simple to complex. Along with the routes they provide XSLT mappings which will essentially only work on payloads. For using HTTP component i had to change the XSLT to add a soap envelop so that when a HTTP call is made to the external webservice it does not fail because after application of XSLT on the payload there is no soap envelop.
2. If we use ServiceMix along with CXF we can easily do this by creating cxf consumers and producers so i am not sure why is this so difficult to do using cxf and camel.

I am planning to debug the Camel CXF codebase to see why OperationBindingInfo is not found even when we explicitly set it on the producer.

Thanks & Regards,
Madhav

Schneider Christian wrote
Status code 500 means internal server error. I guess the endpoint you sent the request to was not able to process the request. Perhaps you will have more details in the log of this endpoint.

It could be some invalid soap for that service...

Best regards

Christian

Christian Schneider
Informationsverarbeitung
Business Solutions
Handel und Dispatching

Tel : +49-(0)721-63-15482

EnBW Systeme Infrastruktur Support GmbH
Sitz der Gesellschaft: Karlsruhe
Handelsregister: Amtsgericht Mannheim ­ HRB 108550
Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
Geschäftsführer: Jochen Adenau, Hans-Günther Meier
Reply | Threaded
Open this post in threaded view
|

Re: AW: AW: Calling external webservice using cxf camel endpoint

Willem.Jiang
Administrator
On 10/27/10 9:36 PM, unmarshall wrote:

>
> Hi Christian,
>
> Thanks for your response. Camel Http component worked but that is not what
> we are looking for. Following are the reasons:
>
> 1. The routes are usually created by the clients and they range from simple
> to complex. Along with the routes they provide XSLT mappings which will
> essentially only work on payloads. For using HTTP component i had to change
> the XSLT to add a soap envelop so that when a HTTP call is made to the
> external webservice it does not fail because after application of XSLT on
> the payload there is no soap envelop.
> 2. If we use ServiceMix along with CXF we can easily do this by creating cxf
> consumers and producers so i am not sure why is this so difficult to do
> using cxf and camel.
>
> I am planning to debug the Camel CXF codebase to see why
> OperationBindingInfo is not found even when we explicitly set it on the
> producer.
>

Can you try to use the trace[1] to print out the messages ?
Maybe the binding operation header is missing in the 4th endpoint.

You can add it back in a customer processor, if the header is missed.

> Thanks&  Regards,
> Madhav
>
>
> Schneider Christian wrote:
>>
>> Status code 500 means internal server error. I guess the endpoint you sent
>> the request to was not able to process the request. Perhaps you will have
>> more details in the log of this endpoint.
>>
>> It could be some invalid soap for that service...
>>
>> Best regards
>>
>> Christian
>>
>> Christian Schneider
>> Informationsverarbeitung
>> Business Solutions
>> Handel und Dispatching
>>
>> Tel : +49-(0)721-63-15482
>>
>> EnBW Systeme Infrastruktur Support GmbH
>> Sitz der Gesellschaft: Karlsruhe
>> Handelsregister: Amtsgericht Mannheim ­ HRB 108550
>> Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
>> Geschäftsführer: Jochen Adenau, Hans-Günther Meier
>>
>>
>


--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Reply | Threaded
Open this post in threaded view
|

Re: AW: AW: Calling external webservice using cxf camel endpoint

unmarshall
Hi Willem,

Thanks for your response. I always have trace on while development. For a producer the binding operation info are never set. A look at the source code for the producer confirms the same.

I added a custom processor which will then add the operation name and namespace. It works if there is one external web service.

Now what is strange is that in case the route has 2 producers then CXF applies transfer-encoding only to the request to the second external webservice.

Following is the request that goes (you can see the Transfer-Encoding=[chunked] there:

01:46:29.404 INFO  [default-workqueue-1] o.a.c.processor.interceptor.Tracer [Logger.java:88] - ID-INLN50091056A-57098-1288728953488-11-5 >>> (route22) com.sap.ping.util.OperationMappingProcessor@504a89f7 --> cxf://bean:salesArrangementERPEndpoint <<< Pattern:InOut, Headers:{User-Agent=Jakarta Commons-HttpClient/3.1, Host=localhost:8080, SOAPAction="http://sap.com/xi/WebService/soap1.1", operationName=salesArrangementERPByIdentifyingElementsQueryResponseIn, accept-encoding=gzip,deflate, ResponseContext={org.apache.cxf.interceptor.DocLiteralInInterceptor.DocLiteralInInterceptor.keep-parameters-wrapper=true, javax.xml.ws.wsdl.port={http://sap.com/xi/APPL/SE/Global}SalesOrderItemByBuyerAndProductQueryResponseInImplPort, org.apache.cxf.service.model.MessageInfo=[MessageInfo OUTPUT: {http://sap.com/xi/APPL/SE/Global}salesOrderItemByBuyerAndProductQueryResponseInResponse], org.apache.cxf.client=true, org.apache.cxf.message.inbound=true, org.apache.cxf.message.Message.PROTOCOL_HEADERS={content-type=[text/xml;charset=utf-8], Date=[Tue, 02 Nov 2010 20:16:29 GMT], transfer-encoding=[chunked], Server=[Apache-Coyote/1.1]}, javax.xml.ws.wsdl.service={http://sap.com/xi/APPL/SE/Global}SalesOrderItemByBuyerAndProductQueryResponse_InService, org.apache.cxf.message.Message.ENCODING=UTF-8, javax.xml.ws.wsdl.interface={http://sap.com/xi/APPL/SE/Global}SalesOrderItemByBuyerAndProductQueryResponseInImpl, javax.xml.ws.wsdl.operation={http://sap.com/xi/APPL/SE/Global}salesOrderItemByBuyerAndProductQueryResponseIn, javax.xml.ws.wsdl.description=http://localhost:8081/jaxws-demows/SalesOrderItemByBuyerAndProductQuery?wsdl, Content-Type=text/xml;charset=utf-8, org.apache.cxf.headers.Header.list=[], org.apache.cxf.message.Message.RESPONSE_CODE=200}, org.apache.cxf.headers.Header.list=[], content-type=text/xml;charset=utf-8, operationNamespace=http://sap.com/xi/APPL/SE/Global, Server=Apache-Coyote/1.1, Date=Tue, 02 Nov 2010 20:16:29 GMT, transfer-encoding=chunked}, BodyType:String, Body:<?xml version="1.0" encoding="UTF-8"?>
<ns1:salesArrangementERPByIdentifyingElementsQueryResponseIn xmlns:ns2="http://sap.com/xi/APPL/SE/Global" xmlns:rootns="http://www.example.com/cmservices" xmlns:ns1="http://sap.com/xi/APPL/SE/Global" xmlns:ns0="http://www.example.com/cmservices">
<arg0>
<SalesArrangement>
<CustomerID/>
<SaleOrganisationalPartyInternalID/>
<DistributionChannelCode/>
<DivisionCode/>
</SalesArrangement>
<outputSize>10</outputSize>
</arg0>
</ns1:salesArrangementERPByIdentifyingElementsQueryResponseIn>

The problem is then even when i have the following configuration, it still applies chunking:

        <http-conf:conduit name="*.http-conduit">
                <http-conf:client AllowChunking="false"/>
        </http-conf:conduit>

Which is strange in my opinion. I have the services hosted on tomcat. Now when the chunked request goes to tomcat it throws an exception:

SEVERE: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
com.sun.xml.ws.protocol.soap.MessageCreationException: Couldn't create SOAP message due to exception: Unable to create StAX reader or writer
        at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:365)
        at com.sun.xml.ws.transport.http.HttpAdapter.decodePacket(HttpAdapter.java:277)
        at com.sun.xml.ws.transport.http.HttpAdapter.access$500(HttpAdapter.java:93)
        at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:457)
        at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
        at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
        at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:203)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:281)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:357)
        at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1671)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:619)
Caused by: com.sun.xml.ws.streaming.XMLReaderException: Unable to create StAX reader or writer
        at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$NoLock.doCreate(XMLStreamReaderFactory.java:412)
        at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$Woodstox.doCreate(XMLStreamReaderFactory.java:436)
        at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.doCreate(XMLStreamReaderFactory.java:201)
        at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory.create(XMLStreamReaderFactory.java:154)
        at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:301)
        at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:129)
        at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:360)
        ... 25 more
Caused by: com.ctc.wstx.exc.WstxIOException: Invalid chunk header
        at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:548)
        at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:604)
        at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:660)
        at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:355)
        at com.sun.xml.ws.api.streaming.XMLStreamReaderFactory$NoLock.doCreate(XMLStreamReaderFactory.java:410)
        ... 31 more
Caused by: java.io.IOException: Invalid chunk header
        at org.apache.coyote.http11.filters.ChunkedInputFilter.doRead(ChunkedInputFilter.java:143)
        at org.apache.coyote.http11.InternalAprInputBuffer.doRead(InternalAprInputBuffer.java:526)
        at org.apache.coyote.Request.doRead(Request.java:426)
        at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:286)
        at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:407)
        at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:309)
        at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:198)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at com.ctc.wstx.io.ReaderBootstrapper.initialLoad(ReaderBootstrapper.java:245)
        at com.ctc.wstx.io.ReaderBootstrapper.bootstrapInput(ReaderBootstrapper.java:132)
        at com.ctc.wstx.stax.WstxInputFactory.doCreateSR(WstxInputFactory.java:543)
        ... 35 more

One of the possible reasons is listed @ http://trenaman.blogspot.com/2008/12/take-care-when-propagating-transport.html - however setting AllowChunking="false" is not working for me. So i am stuck yet again.

Any help would be appreciated.

Best Regards,
madhav

Willem.Jiang wrote
On 10/27/10 9:36 PM, unmarshall wrote:
>
> Hi Christian,
>
> Thanks for your response. Camel Http component worked but that is not what
> we are looking for. Following are the reasons:
>
> 1. The routes are usually created by the clients and they range from simple
> to complex. Along with the routes they provide XSLT mappings which will
> essentially only work on payloads. For using HTTP component i had to change
> the XSLT to add a soap envelop so that when a HTTP call is made to the
> external webservice it does not fail because after application of XSLT on
> the payload there is no soap envelop.
> 2. If we use ServiceMix along with CXF we can easily do this by creating cxf
> consumers and producers so i am not sure why is this so difficult to do
> using cxf and camel.
>
> I am planning to debug the Camel CXF codebase to see why
> OperationBindingInfo is not found even when we explicitly set it on the
> producer.
>

Can you try to use the trace[1] to print out the messages ?
Maybe the binding operation header is missing in the 4th endpoint.

You can add it back in a customer processor, if the header is missed.

> Thanks&  Regards,
> Madhav
>
>
> Schneider Christian wrote:
>>
>> Status code 500 means internal server error. I guess the endpoint you sent
>> the request to was not able to process the request. Perhaps you will have
>> more details in the log of this endpoint.
>>
>> It could be some invalid soap for that service...
>>
>> Best regards
>>
>> Christian
>>
>> Christian Schneider
>> Informationsverarbeitung
>> Business Solutions
>> Handel und Dispatching
>>
>> Tel : +49-(0)721-63-15482
>>
>> EnBW Systeme Infrastruktur Support GmbH
>> Sitz der Gesellschaft: Karlsruhe
>> Handelsregister: Amtsgericht Mannheim ­ HRB 108550
>> Vorsitzender des Aufsichtsrats: Dr. Bernhard Beck
>> Geschäftsführer: Jochen Adenau, Hans-Günther Meier
>>
>>
>


--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Reply | Threaded
Open this post in threaded view
|

Re: AW: AW: Calling external webservice using cxf camel endpoint

unmarshall
Hi Willem,

Another thing to note is the issue @ CAMEL-2452

We have recently moved to Camel 2.5 distribution and i still see:

 protected void initialize() {
        getOutFilter().add("content-length");
        getOutFilter().add("content-type");
        // Add the filter for the Generic Message header
        // http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.5
        getOutFilter().add("cache-control");
        getOutFilter().add("connection");
        getOutFilter().add("date");
        getOutFilter().add("pragma");
        getOutFilter().add("trailer");
        getOutFilter().add("transfer-encoding");
        getOutFilter().add("upgrade");
        getOutFilter().add("via");
        getOutFilter().add("warning");
       
        setLowerCase(true);

As the headers are case sensitive i guess you will have to change it to camel case as per the issue raised earlier.

Can we expect this as a patch for 2.5 release?

Best Regards,
Madhav

unmarshall wrote
Hi Willem,

Thanks for your response. I always have trace on while development. For a producer the binding operation info are never set. A look at the source code for the producer confirms the same.

....