- WSDL 元素
- WSDL - <definitions>
- WSDL - <types>
- WSDL - <message>
- WSDL - <portType>
- WSDL - <binding>
- WSDL - <ports>
- WSDL - <service>
- WSDL 有用資源
- WSDL - 快速指南
- WSDL - 有用資源
- WSDL - 討論
WSDL - <message> 元素
<message> 元素描述在 Web 服務提供商與使用者之間交換的資料。
每個 Web 服務具有兩條訊息:輸入和輸出。
輸入描述 Web 服務的引數,而輸出描述 Web 服務的返回資料。
每條訊息都包含零個或更多 <part> 引數,每個引數對應一個 Web 服務函式的引數。
每個 <part> 引數與在 <types> 容器元素中定義的具體型別關聯。
讓我們從 WSDL 示例章節中獲取一部分程式碼 −
<message name = "SayHelloRequest"> <part name = "firstName" type = "xsd:string"/> </message> <message name = "SayHelloResponse"> <part name = "greeting" type = "xsd:string"/> </message>
在此,定義了兩條訊息元素。第一個表示請求訊息 SayHelloRequest,第二個表示響應訊息 SayHelloResponse。
這些訊息中每個都包含一個單一部分元素。對於請求,該部分指定函式的引數;在這種情況下,我們指定一個單一 firstName 引數。對於響應,該部分指定函式的返回值;在這種情況下,我們指定一個單一的 greeting 返回值。
廣告