国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 編程設計 > 正文

SOAP第4課:SOAP Header 元素

2020-12-12 13:51:15
字體:
來源:轉載
供稿:網友
可選的 SOAP Header 元素包含頭部信息。

SOAP Header 元素
可選的 SOAP Header 元素可包含有關 SOAP 消息的應用程序專用信息(比如認證、支付等)。如果 Header 元素被提供,則它必須是 Envelope 元素的第一個子元素。

注釋:所有 Header 元素的直接子元素必須是合格的命名空間。

<?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">

<soap:Header>
<m:Trans
xmlns:m="http://www.w3school.com.cn/transaction/"
soap:mustUnderstand="1">234</m:Trans>
</soap:Header>

...
...

</soap:Envelope>

上面的例子包含了一個帶有一個 "Trans" 元素的頭部,它的值是 234,此元素的 "mustUnderstand" 屬性的值是 "1"。

SOAP 在默認的命名空間中 ("http://www.w3.org/2001/12/soap-envelope") 定義了三個屬性。這三個屬性是:actor、 mustUnderstand 以及 encodingStyle。這些被定義在 SOAP 頭部的屬性可定義容器如何對 SOAP 消息進行處理。

actor 屬性
通過沿著消息路徑經過不同的端點,SOAP 消息可從某個發送者傳播到某個接收者。并非 SOAP 消息的所有部分均打算傳送到 SOAP 消息的最終端點,不過,另一個方面,也許打算傳送給消息路徑上的一個或多個端點。

SOAP 的 actor 屬性可被用于將 Header 元素尋址到一個特定的端點。

語法

soap:actor="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">

<soap:Header>
<m:Trans
xmlns:m="http://www.w3school.com.cn/transaction/"
soap:actor="http://www.w3school.com.cn/appml/">
234
</m:Trans>
</soap:Header>

...
...

</soap:Envelope>

mustUnderstand 屬性
SOAP 的 mustUnderstand 屬性可用于標識標題項對于要對其進行處理的接收者來說是強制的還是可選的。

假如您向 Header 元素的某個子元素添加了 "mustUnderstand="1",則它可指示處理此頭部的接收者必須認可此元素。假如此接收者無法認可此元素,則在處理此頭部時必須失效。

語法

soap:mustUnderstand="0|1"

實例

<?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">

<soap:Header>
<m:Trans
xmlns:m="http://www.w3school.com.cn/transaction/"
soap:mustUnderstand="1">
234
</m:Trans>
</soap:Header>

...
...

</soap:Envelope>

encodingStyle 屬性
SOAP 的 encodingStyle 屬性在上一節中已解釋過了。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 枣强县| 康平县| 敖汉旗| 龙山县| 平安县| 通州市| 陇南市| 瑞昌市| 安图县| 丽江市| 株洲市| 阳曲县| 项城市| 偃师市| 襄樊市| 惠东县| 汝州市| 河东区| 东乡族自治县| 石景山区| 巍山| 平武县| 垦利县| 舒兰市| 鄯善县| 南岸区| 侯马市| 乐昌市| 图木舒克市| 梅州市| 香格里拉县| 恩施市| 沽源县| 黎城县| 怀来县| 遂川县| 泸州市| 石台县| 渝中区| 原平市| 团风县|