我以这种方式在 WSDL 文件上定义了我的服务:
<wsdl:service name="guestbook">
<wsdl:port binding="tns:guestbookSOAP" name="guestbookSOAP">
<soap:address location="http://localhost:8080/soapguestbook"/>
</wsdl:port>
在其上运行 wsimport 时,我仍然收到以下错误消息:
At least one WSDL with at least one service definition needs to be provided.
我还有什么需要补充的吗?
最佳答案
您的问题是缺少定义元素,就像根一样。
WSDL 有一个特定的结构,根元素应该是定义,在它下面还有各种其他元素,如类型、消息、端口类型、绑定(bind)、服务等。
结构如下:
<definitions>
<types> data type definitions........ </types>
<message> definition of the data being communicated.... </message>
<portType> set of operations...... </portType>
<binding> protocol and data format specification.... </binding>
</definitions>
有关每个 WSDL 元素的含义,请查看链接:
https://www.w3schools.com/xml/xml_wsdl.asp
关于soap - 需要提供至少一个具有至少一个服务定义的 WSDL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17375453/