2025年3月25日 星期二 甲辰(龙)年 月廿四 设为首页 加入收藏
rss
您当前的位置:首页 > 计算机 > 网络通信

SOAP 实例

时间:06-03来源:作者:点击数:36

一个 SOAP 实例

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

SOAP 请求:

  • POST /InStock HTTP/1.1
  • Host: www.example.org
  • Content-Type: application/soap+xml; charset=utf-8
  • Content-Length: nnn
  • <?xml version="1.0"?>
  • <soap:Envelope
  • xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
  • soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  • <soap:Body xmlns:m="http://www.example.org/stock">
  • <m:GetStockPrice>
  • <m:StockName>IBM</m:StockName>
  • </m:GetStockPrice>
  • </soap:Body>
  • </soap:Envelope>

SOAP 响应:

  • HTTP/1.1 200 OK
  • Content-Type: application/soap+xml; charset=utf-8
  • Content-Length: nnn
  • <?xml version="1.0"?>
  • <soap:Envelope
  • xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
  • soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  • <soap:Body xmlns:m="http://www.example.org/stock">
  • <m:GetStockPriceResponse>
  • <m:Price>34.5</m:Price>
  • </m:GetStockPriceResponse>
  • </soap:Body>
  • </soap:Envelope>

 

方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
上一篇:SOAP HTTP 协议 下一篇:SOAP 总结
推荐内容
相关内容
栏目更新
栏目热门