两个SOAP封装例子

网络 网络管理
这里我们针对SOAP封装的内容,列举了两个代码例子。那么通过下面的两则例子,希望大家能够得到一些有价值的参考。

对于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> 

 

责任编辑:佟健 来源: hi.baidu.com
相关推荐

2010-09-10 15:33:26

SOAP协议应答编码

2009-08-12 16:37:22

C#变量类型转换

2021-02-07 21:59:39

Java回调机制

2022-06-17 09:46:51

Chrome 102Chrome浏览器

2020-11-13 07:16:09

线程互斥锁死循环

2009-07-16 10:39:00

SwingUtilit

2010-09-17 09:51:37

SIP路由

2010-07-02 12:26:51

LEACH协议

2009-07-15 18:29:22

Jython应用

2017-01-15 01:45:37

简历简历模板数据

2021-08-03 08:13:47

数据

2019-06-25 10:46:04

Flutter开发APP

2013-07-05 10:52:07

程序员结对编程

2010-02-25 16:45:13

WCF应用技巧

2010-05-28 09:57:50

TortoiseSVN

2010-07-17 00:59:44

cmd Telnet

2010-08-23 17:34:06

DHCP协议

2015-02-05 09:54:13

程序员

2013-08-09 10:05:41

亚马逊团队

2011-07-05 16:13:18

点赞
收藏

51CTO技术栈公众号