WSDL 2.0文件結構


如前所述,WSDL 2.0使用6層元件來定義Web服務:型別,操作,介面,係結,端點和服務。

WSDL 2.06層元件按照以下規則編寫在XML文件中:

  • <description>是根元素。
  • <types>是頂級元素,用作表示Types元件的容器。
  • <interface>是頂級元素,用作表示Interface元件的定義,該元件包含一組操作元件。
  • <binding>是頂級元素,用作表示Binding元件的定義。
  • <service>是頂級元素,用作表示Service元件的定義,該元件包含一組Endpoint元件。

WSDL 2.0 XML文件的結構可以表示為:

<description ...>
  <types>
    ...
  </types>

  <interface ...>
    <operation ...>
      <input>
        ...
      </input>
      <output>
        ...
      </output>
      ...
    </operation>
  </interface>

  <binding ...>
    <operation .../>
  </binding>

  <service ...>
    <port .../>
    ...
  </service>

</description>