至少需要提供一个具有至少一个服务定义的WSDL

时间:2013-06-29 00:23:36

标签: soap wsdl

我已经通过这种方式在WSDL文件上定义了我的服务:

<wsdl:service name="guestbook">
<wsdl:port binding="tns:guestbookSOAP" name="guestbookSOAP">
  <soap:address location="http://localhost:8080/soapguestbook"/>
</wsdl:port>

在运行wsimport时,我仍然收到以下错误消息:

  

至少需要提供一个至少具有一个服务定义的WSDL。

我还需要添加其他内容吗?

1 个答案:

答案 0 :(得分:2)

您的案例中的问题是缺少定义元素,就像根。

WSDL有一个特定的结构,根元素应该是DEFINITIONs,在它下面存在各种其他元素,如类型,消息,portType,绑定,服务等。

结构如下:

<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

相关问题