強制使用的 SOAP 的 Envelope 元素是 SOAP 消息的根元素。
SOAP Envelope 元素
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:encoding>xmlns:soap 命名空間
SOAP 消息必須擁有與命名空間 "http://www.w3.org/2001/12/soap-envelope" 相關聯的一個 Envelope 元素。
如果使用了不同的命名空間,應用程序會發生錯誤,并拋棄此消息。
encodingStyle 屬性
SOAP 的 encodingStyle 屬性用于定義在文檔中使用的數據類型。此屬性可出現在任何 SOAP 元素中,并會被應用到元素的內容及元素的所有子元素上。SOAP 消息沒有默認的編碼方式。
語法
soap:encoding>實例
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encoding>