加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

webservice 相关 http+SOAP 报文范例 ,以及 soap1.1 和 soap 1.

发布时间:2020-12-16 23:12:32 所属栏目:安全 来源:网络整理
导读:soap1.1 和 1.2 的区别主要表现在? 区别 (1) http头的? Content-Type: 字段 1.1的?Content-Type: ?text/xml; charset=utf-8? 1.2的? ? Content-Type: application/soap+xml; charset=utf-8 区别(2) http头的 SOAPAction: 字段 1.1的要求有? SOAPAction:
soap1.1 和 1.2 的区别主要表现在?
区别 (1)
http头的?Content-Type: 字段
1.1的?Content-Type:?text/xml; charset=utf-8?
1.2的??Content-Type: application/soap+xml; charset=utf-8
区别(2)
http头的SOAPAction: 字段
1.1的要求有?SOAPAction: ?字段,内容为 明明空间+方法名
1.2版本 不需要?SOAPAction: 字段
区别(3)
namespace不同
1.1版本的namespace ?为?http://www.w3.org/2003/05/soap-envelope
1.2版本的namespace 为?http://schemas.xmlsoap.org/soap/envelope/
SOAP 1.2范例

SOAP 请求:

POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?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:Body xmlns:m="http://www.example.org/stock">
?? <m:GetStockPrice>
<m:StockName>IBM</m:StockName>
????</m:GetStockPrice>
</soap:Body>
</soap:Envelope>

SOAP 响应:

HTTP/1.1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <?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:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse> </soap:Body> </soap:Envelope>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读