对于SOAP协议的内容,我们在前面的文章中已经讲解过了它的基础内容。这里我们主要针对SOAP封装进行一下案例的分析。那么下边我们主要举出了两个SOAP封装的例子,给大家提供一个参考。
SOAP封装:请求编码举例
SOAP封装例1
- POST /StockQuote HTTP/1.1
- Host: www.stockquoteserver.com
- Content-Type: text/xml; charset="utf-8"
- Content-Length: nnnn
- SOAPAction: "Some-URI"
- <SOAP-ENV:Envelope
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- SOAP-ENV:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <SOAP-ENV:Header>
- <t:Transaction
- xmlns:t="some-URI"
- SOAP-ENV:mustUnderstand="1">
- 5
- </t:Transaction>
- </SOAP-ENV:Header>
- <SOAP-ENV:Body>
- <m:GetLastTradePrice xmlns:m="Some-URI">
- <symbol>DEF</symbol>
- </m:GetLastTradePrice>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
SOAP封装例2
- POST /StockQuote HTTP/1.1
- Host: www.stockquoteserver.com
- Content-Type: text/xml; charset="utf-8"
- Content-Length: nnnn
- SOAPAction: "Some-URI"
- <SOAP-ENV:Envelope
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- SOAP-ENV:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <SOAP-ENV:Body>
- <m:GetLastTradePriceDetailed
- xmlns:m="Some-URI">
- <Symbol>DEF</Symbol>
- <Company>DEF Corp</Company>
- <Price>34.1</Price>
- </m:GetLastTradePriceDetailed>
- </SOAP-ENV:Body>
- </SOAP-ENV:Envelope>
推荐阅读
学习了一段时间的网络协议,相信大家已经对一些常规的网络协议有所了解了。那么这里我们主要介绍一下SOAP协议的内容。SOAP协议:简单对象访问协议(SOAP:Simple Object Access Protocol),简单对象访问协议(SOAP)是>>>详细阅读
本文标题:两个SOAP封装例子
地址:http://www.17bianji.com/xieyi/3374.html
1/2 1