我尝试向SOAP Webservice throw camel路由发送POST请求,得到了以下错误消息:
org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {http://www.webserviceX.NET/}GlobalWeather.
这是路线:
<route id="my_Sample_Camel_Route_with_CXF">
<from uri="file:src/data?noop=true"/>
<log loggingLevel="INFO" message=">>> ${body}"/>
<to uri="cxf://http://www.webservicex.net/globalweather.asmx?wsdlURL=http://www.webservicex.net/globalweather.asmx?wsdl&serviceName={http://www.webserviceX.NET/}GlobalWeather&portName={http://www.webserviceX.NET/}GlobalWeatherSoap&dataFormat=MESSAGE"/>
<log loggingLevel="INFO" message=">>> ${body}"/>
</route>
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>
我怎么能修好它?