WSDL <ports>元素

WSDL <ports>元素通过为绑定指定单个地址来定义单个端点。

这是指定端口的语法 -

<wsdl:definitions .... >
   <wsdl:service .... > *
      <wsdl:port name = nmtoken binding = qname> *
         <-- extensibility element (1) -->
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>
  • port元素有两个属性:namebinding
  • name属性在封闭的WSDL文档中定义的所有端口中提供唯一名称。
  • binding属性是指使用WSDL定义的链接规则进行绑定。
  • 绑定可扩展性元素用于指定端口的地址信息。
  • 端口不得指定多个地址。
  • 端口不得指定除地址信息之外的任何绑定信息。

以下是示例章节中的一段代码 -

<service name = Hello_Service>
   <documentation>WSDL File for HelloService</documentation>
   <port binding = tns:Hello_Binding name = Hello_Port>
      <soap:address
         location = http://www.examples.com/SayHello/>
   </port>
</service>