WSDL 2.0文檔結構
如前所述,WSDL 2.0使用6層組件來定義Web服務:類型,操作,接口,綁定,端點和服務。
WSDL 2.0這6層組件按照以下規則編寫在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>