web-services - 通过服务中的 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>
任何人的任何想法?
解决方案
推荐阅读
- html - 如何使整个 HTML 日期字段可点击?
- java - 如何从数据创建 5mb 块大小的文件
- typescript - 流程:从现有类型创建类型作为字符串文字
- javascript - 如何使用 React Leaflet 放置加载事件处理程序?
- c - 为什么 Dart FFI 会从这个 C 结构中生成一个不透明的类?
- php - 清理 WP metabox 中的 PHP 文本区域,允许 HTML 标记
- javascript - 按全名过滤数据 React
- python - Bokeh 是否需要/想要 add_next_tick_callback() 中的协程?
- javascript - 本地存储和将阵列存储到本地存储中
- android-studio - Android Studio - ViewPager 中的 VideoView 预览问题