Apache Camel - 调用 SOAP 网络服务时出错
Apache Camel - Error when calling a SOAP webservice
我尝试向 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>
我该如何解决?
末尾的"/"
必须删掉
应该是这样的:
serviceName={http://www.webserviceX.NET}GlobalWeather&
portName={http://www.webserviceX.NET}GlobalWeatherSoap
我尝试向 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>
我该如何解决?
"/"
必须删掉
应该是这样的:
serviceName={http://www.webserviceX.NET}GlobalWeather&
portName={http://www.webserviceX.NET}GlobalWeatherSoap