课程表

Web Services 教程

WSDL 教程

SOAP 教程

工具箱
速查手册

SOAP 实例

当前位置:免费教程 » 其他 » Web Services

一个 SOAP 实例

在下面的例子中,一个 GetStockPrice 请求被发送到了服务器。此请求有一个 StockName 参数,而在响应中则会返回一个 Price 参数。此功能的命名空间被定义在此地址中: "http://www.example.org/stock"

SOAP 请求:

  1. POST /InStock HTTP/1.1
  2. Host: www.example.org
  3. Content-Type: application/soap+xml; charset=utf-8
  4. Content-Length: nnn
  5.  
  6. <?xml version="1.0"?>
  7. <soap:Envelope
  8. xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
  9. soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  10.  
  11. <soap:Body xmlns:m="http://www.example.org/stock">
  12.    <m:GetStockPrice>
  13. <m:StockName>IBM</m:StockName>
  14.     </m:GetStockPrice>
  15. </soap:Body>
  16. </soap:Envelope>

SOAP 响应:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/soap+xml; charset=utf-8
  3. Content-Length: nnn
  4.  
  5. <?xml version="1.0"?>
  6. <soap:Envelope
  7. xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
  8. soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  9.  
  10. <soap:Body xmlns:m="http://www.example.org/stock">
  11. <m:GetStockPriceResponse>
  12. <m:Price>34.5</m:Price>
  13. </m:GetStockPriceResponse>
  14. </soap:Body>
  15. </soap:Envelope>
转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号