SOAP Envelope 元素

 

強制使用的 SOAP 的 Envelope 元素是 SOAP 消息的根元素。

SOAP Envelope 元素

必需的 SOAP 的 Envelope 元素是 SOAP 消息的根元素。它可把 XML 文檔定義爲 SOAP 消息。

請注意 xmlns:soap 命名空間的使用。它的值應當始終是:

http://www.w3.org/2001/12/soap-envelope

並且它可把封裝定義爲 SOAP 封裝:

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  ...
  Message information goes here
  ...
</soap:Envelope>

xmlns:soap 命名空間

SOAP 消息必須擁有與命名空間 "http://www.w3.org/2001/12/soap-envelope" 相關聯的一個 Envelope 元素。

如果使用了不同的命名空間,應用程序會發生錯誤,並拋棄此消息。

encodingStyle 屬性

SOAP 的 encodingStyle 屬性用於定義在文檔中使用的數據類型。此屬性可出現在任何 SOAP 元素中,並會被應用到元素的內容及元素的所有子元素上。SOAP 消息沒有默認的編碼方式。

語法

soap:encodingStyle="URI"

實例

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
...
Message information goes here
...
</soap:Envelope>
發佈了28 篇原創文章 · 獲贊 3 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章