Details
Description
Webservice [1] contains two operations.
Following route works:
from("timer:cTimer_1?period=1&repeatCount=1&delay=1")
.setBody().constant("<web:GetWeather xmlns:web='http://www.webserviceX.NET'><web:CityName>Minsk</web:CityName></web:GetWeather>")
.to("cxf://http://www.webservicex.net/globalweather.asmx?wsdlURL=F:/globalweather.wsdl&dataFormat=PAYLOAD&serviceName=
GlobalWeather&endpointName=
{http://www.webserviceX.NET}GlobalWeatherSoap")
.to("log:cLog_1?level=INFO")
But with body
<web:GetCitiesByCountry xmlns:web='http://www.webserviceX.NET'><web:CountryName>Belarus</web:CountryName></web:GetCitiesByCountry>
there is exception [2].
Looking into the sources [3] I found that first available opration used.
Expected that operation lookup is based on payload root element (which is different for operations)
1. http://www.webservicex.net/globalweather.asmx?WSDL
2.
[WARN ]: org.apache.camel.component.timer.TimerConsumer - Error processing exchange. Exchange[Message: <web:GetCitiesByCountry xmlns:web='http://www.webserviceX.NET'><web:CountryName>Belarus</web:CountryName></web:GetCitiesByCountry>]. Caused by: [java.lang.IllegalArgumentException - The PayLoad elements cannot fit with the message parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage.]
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:1011)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:526)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:472)
at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:112)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:113)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:139)
at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:64)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)