Search code examples
web-servicessoapwsdlapache-camelblueprint-osgi

Apache Camel - Error when calling a SOAP webservice


I try to send a POST request to a SOAP Webservice throw camel route, and i got this error message :

org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {http://www.webserviceX.NET/}GlobalWeather.

This is the route:

<route id="my_Sample_Camel_Route_with_CXF">
       <from uri="file:src/data?noop=true"/>
       <log loggingLevel="INFO" message="&gt;&gt;&gt; ${body}"/>
       <to uri="cxf://http://www.webservicex.net/globalweather.asmx?wsdlURL=http://www.webservicex.net/globalweather.asmx?wsdl&amp;serviceName={http://www.webserviceX.NET/}GlobalWeather&amp;portName={http://www.webserviceX.NET/}GlobalWeatherSoap&amp;dataFormat=MESSAGE"/>
       <log loggingLevel="INFO" message="&gt;&gt;&gt; ${body}"/>
</route>

service defenition in WSDL:

<wsdl:service name="GlobalWeather">
<wsdl:port name="GlobalWeatherSoap" binding="tns:GlobalWeatherSoap">
<soap:address location="http://www.webservicex.net/globalweather.asmx"/>
</wsdl:port>
<wsdl:port name="GlobalWeatherSoap12" binding="tns:GlobalWeatherSoap12">
<soap12:address location="http://www.webservicex.net/globalweather.asmx"/>
</wsdl:port>
<wsdl:port name="GlobalWeatherHttpGet" binding="tns:GlobalWeatherHttpGet">
<http:address location="http://www.webservicex.net/globalweather.asmx"/>
</wsdl:port>
<wsdl:port name="GlobalWeatherHttpPost" binding="tns:GlobalWeatherHttpPost">
<http:address location="http://www.webservicex.net/globalweather.asmx"/>
</wsdl:port>
</wsdl:service>

How can i fix it ?


Solution

  • "/" at the end must be deleted.

    it should be like this:

    serviceName={http://www.webserviceX.NET}GlobalWeather&amp;
    portName={http://www.webserviceX.NET}GlobalWeatherSoap