作家
登录

四个SOAP协议应答编码例子

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

对于SOAP协议的一些基本概念我们在这里不多赘述了。前面我们也对SOAP封装的内容进行了一些举例讲解,这里我们再来对SOAP协议应答编码的一些例子尽心改一下介绍。

SOAP协议应答编码例1

  1. HTTP/1.1 200 OK  
  2. Content-Type: text/xml; charset="utf-8" 
  3. Content-Length: nnnn  
  4. <SOAP-ENV:Envelope 
  5. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
  6. SOAP-ENV:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
  7. <SOAP-ENV:Header> 
  8. <t:Transaction xmlns:t="some-URI" xsi:type="xsd:int" mustUnderstand="1"> 5 </t:Transaction> 
  9. </SOAP-ENV:Header> 
  10. <SOAP-ENV:Body> 
  11. <m:GetLastTradePriceResponse xmlns:m="Some-URI"> 
  12. <Price>34.5</Price> 
  13. </m:GetLastTradePriceResponse> 
  14. </SOAP-ENV:Body> 
  15. </SOAP-ENV:Envelope> 

SOAP协议应答编码例2

  1. HTTP/1.1 200 OK  
  2. Content-Type: text/xml; charset="utf-8" 
  3. Content-Length: nnnn  
  4. <SOAP-ENV:Envelope 
  5. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
  6. SOAP-ENV:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/"/> 
  7. <SOAP-ENV:Body> 
  8. <m:GetLastTradePriceResponse 
  9. xmlns:m="Some-URI"> 
  10. <PriceAndVolume> 
  11. <LastTradePrice> 34.5 </LastTradePrice> 
  12. <DayVolume> 10000 </DayVolume> 
  13. </PriceAndVolume> 
  14. </m:GetLastTradePriceResponse> 
  15. </SOAP-ENV:Body> 
  16. </SOAP-ENV:Envelope> 

SOAP协议应答编码例3

  1. HTTP/1.1 500 Internal Server Error  
  2. Content-Type: text/xml; charset="utf-8" 
  3. Content-Length: nnnn  
  4. <SOAP-ENV:Envelope 
  5. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
  6. <SOAP-ENV:Body> 
  7. <SOAP-ENV:Fault> 
  8. <faultcode>SOAP-ENV:MustUnderstand</faultcode> 
  9. <faultstring>SOAP Must Understand Error</faultstring> 
  10. </SOAP-ENV:Fault> 
  11. </SOAP-ENV:Body> 
  12. </SOAP-ENV:Envelope> 

SOAP协议应答编码例4

  1. HTTP/1.1 500 Internal Server Error  
  2. Content-Type: text/xml; charset="utf-8" 
  3. Content-Length: nnnn  
  4. <SOAP-ENV:Envelope 
  5. xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> 
  6. <SOAP-ENV:Body> 
  7. <SOAP-ENV:Fault> 
  8. <faultcode>SOAP-ENV:Server</faultcode> 
  9. <faultstring>Server Error</faultstring> 
  10. <detail> 
  11. <e:myfaultdetails xmlns:e="Some-URI"> 
  12. <message> 
  13. My application didn't work  
  14. </message> 
  15. <errorcode> 1001 </errorcode> 
  16. </e:myfaultdetails> 
  17. </detail> 
  18. </SOAP-ENV:Fault> 
  19. </SOAP-ENV:Body> 
  20. </SOAP-ENV:Envelope> 


  推荐阅读

  两个SOAP封装例子

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


本文标题:四个SOAP协议应答编码例子

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

关键词: 探索发现

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

网友点评
自媒体专栏

评论

热度

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