代码之家  ›  专栏  ›  技术社区  ›  zied123456

Apache Camel-调用SOAP Web服务时出错

  •  0
  • zied123456  · 技术社区  · 8 年前

    我尝试向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="&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>
    

    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>
    

    我怎么能修好它?

    1 回复  |  直到 8 年前
        1
  •  0
  •   zied123456    8 年前

    "/" 最后必须删除。

    应该是这样的:

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