首页 > 解决方案 > 通过服务中的 URL 检索 wsdl 时出错

问题描述

在我的应用程序中,我用作 Web 服务器 Widlfly 17.0.1 和 wsdl webservices Axis2 1.7.6

尝试通过客户端程序从服务器 URL(如http://myserver:8080/myapp/services/MyService?wsdl )通过 URL 检索 wsdl 时出现错误

当我在浏览器中点击 URL 时,我得到

<error>
  <description>Unable to generate WSDL 1.1 for this service</description>
  <reason>
    If you wish Axis2 to automatically generate the WSDL 1.1, then please set useOriginalwsdl as false in 
    your services.xml
  </reason>
</error>

到目前为止,我已经尝试了这里建议的解决方案useOriginalwsdl=true 在axis2中不起作用 但没有成功,错误仍然保持不变。

此外,我的 wsdl 和 xsd 似乎是有效的,并且服务器服务端点也可以正常工作并且符合预期。

当我使用带有提供的 wsdl 的 soapUI 或我的客户端时,该服务似乎工作正常并且正在返回所需的响应。

但是我需要通过服务器服务 URL(如http://myserver:8080/myapp/services/MyService?wsdl )将 wsdl 检索到客户端,因为由于技术限制,我无法在客户端项目中提供它。

我的 services.xml 如下:

   <service name="MyService">
        <messageReceivers>
            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.test.MyServiceMessageReceiverInOut"/>
        </messageReceivers>
        <parameter name="ServiceClass">org.test.MyServiceSkeleton</parameter>
        <parameter name="useOriginalwsdl">true</parameter>
        <parameter name="modifyUserWSDLPortAddress">true</parameter>
        <operation name="getDocument" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://ws.test.org/myapp/myservice">
            <actionMapping>getValue</actionMapping>
            <outputActionMapping>http://ws.test.org/myapp/myservice/myservicePortType/output2</outputActionMapping>
        </operation>
        <operation name="setValue" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://ws.test.org/myapp/myservice">
            <actionMapping>setValue</actionMapping>
            <outputActionMapping>http://ws.test.org/myapp/myservice/myservicePortType/output1</outputActionMapping>
        </operation>
    </service>

wsdl文件里面的服务声明如下:

   <service name="MyService">
        <port name="myservicePort" binding="tns:myserviceBinding">
            <soap:address location="http://${MyHost}:${MyPort}/myapp/services/MyService"/>
        </port>
    </service>

任何人的任何想法?

标签: web-servicessoapwsdlaxis2wildfly-17

解决方案


推荐阅读