作家
登录

两个SOAP封装例子

作者: 来源: 2012-06-13 01:23:56 阅读 我要评论

对于SOAP协议的内容,我们在前面的文章中已经讲解过了它的基础内容。这里我们主要针对SOAP封装进行一下案例的分析。那么下边我们主要举出了两个SOAP封装的例子,给大家提供一个参考。

SOAP封装:请求编码举例

SOAP封装例1

  1. POST /StockQuote HTTP/1.1  
  2. Host: www.stockquoteserver.com  
  3. Content-Type: text/xml; charset="utf-8" 
  4. Content-Length: nnnn  
  5. SOAPAction: "Some-URI"  
  6. <SOAP-ENV:Envelope 
  7. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
  8. SOAP-ENV:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
  9. <SOAP-ENV:Header> 
  10. <t:Transaction 
  11. xmlns:t="some-URI" 
  12. SOAP-ENV:mustUnderstand="1"> 
  13. 5  
  14. </t:Transaction> 
  15. </SOAP-ENV:Header> 
  16. <SOAP-ENV:Body> 
  17. <m:GetLastTradePrice xmlns:m="Some-URI"> 
  18. <symbol>DEF</symbol> 
  19. </m:GetLastTradePrice> 
  20. </SOAP-ENV:Body> 
  21. </SOAP-ENV:Envelope> 

SOAP封装例2

  1. POST /StockQuote HTTP/1.1  
  2. Host: www.stockquoteserver.com  
  3. Content-Type: text/xml; charset="utf-8" 
  4. Content-Length: nnnn  
  5. SOAPAction: "Some-URI"  
  6. <SOAP-ENV:Envelope 
  7. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
  8. SOAP-ENV:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
  9. <SOAP-ENV:Body> 
  10. <m:GetLastTradePriceDetailed 
  11. xmlns:m="Some-URI"> 
  12. <Symbol>DEF</Symbol> 
  13. <Company>DEF Corp</Company> 
  14. <Price>34.1</Price> 
  15. </m:GetLastTradePriceDetailed> 
  16. </SOAP-ENV:Body> 
  17. </SOAP-ENV:Envelope> 


  推荐阅读

  对于SOAP协议的全面介绍

学习了一段时间的网络协议,相信大家已经对一些常规的网络协议有所了解了。那么这里我们主要介绍一下SOAP协议的内容。SOAP协议:简单对象访问协议(SOAP:Simple Object Access Protocol),简单对象访问协议(SOAP)是>>>详细阅读


本文标题:两个SOAP封装例子

地址:http://www.17bianji.com/xieyi/3374.html

关键词: 探索发现

乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

网友点评
自媒体专栏

评论

热度

精彩导读
栏目ID=71的表不存在(操作类型=0)