You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by niteshjain <ni...@gmail.com> on 2015/11/09 10:46:55 UTC

How to invoke a webservice with dataFormat as PAYLOAD

 0
down vote
favorite
	

I'm using camel 2.16.0

Created a camel route to invoke a web service, dataFormat as *MESSAGE *and i
get the response normally. and this route is invoked using ProducerTemlate

//payloadXml is a string which contains SOAP Request Message.
Object response = producerTemplate.requestBody("direct:invokeWS",
payloadXml);

<route id="my_Sample_Camel_Route_with_CXF">
<from uri="direct:invokeWS" />
    <to
uri="cxf://http://localhost:8111/camel_MQ/TestService?wsdlURL=http://localhost:8111/camel_MQ/TestService?wsdl&amp;serviceName={http://www.test.org/interface/test/ws}camel_MQ-ws&amp;portName={http://www.test.org/interface/test}TestEndpoint&amp;dataFormat=MESSAGE"
/>
<log message="------------->> ${body}" />
</route>

But once i change the dataFormat to "*PAYLOAD*"

I get exception.

Caused by: java.lang.IllegalArgumentException: The PayLoad elements cannot
fit with the message parts of the BindingOperation. Please check the
BindingOperation and PayLoadMessage.
    at
org.apache.camel.component.cxf.CxfEndpoint$CamelCxfClientImpl.setParameters(CxfEndpoint.java:1171)

do i need to create CxfPayload and then send that to producerTeamplate ? if
yes then how to create CxfPayload from a SOAP Request (which is a STring)...




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-invoke-a-webservice-with-dataFormat-as-PAYLOAD-tp5773521.html
Sent from the Camel - Users mailing list archive at Nabble.com.