SOAP和HTTP协议之间的区别? [英] Difference between SOAP and HTTP protocol?

查看:754
本文介绍了SOAP和HTTP协议之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SOAP和HTTP协议之间有什么区别.当我们说"HTTP上的SOAP"时,这是什么意思??

What is the difference between the SOAP and HTTP protocol. When we say "SOAP over HTTP", what does that mean.?

推荐答案

您可以通过HTTP提供任何内容,例如HTML,图像,声音,视频等.SOAP是基于XML的消息编码,通常通过HTTP,但可以通过SMTP甚至FTP发送,尽管我从未见过在生产环境中使用过这样的系统.

You can serve any content over HTTP such as HTML, images, sound, video, etc. SOAP is an XML-based encoding of messages that are typically sent over HTTP, but could be sent over SMTP or even FTP, although I've never seen such a system used in a production environment.

就像HTTP位于TCP/IP之上一样,SOAP也位于HTTP之上.层在层之上...

Just like HTTP sits on top of TCP/IP, SOAP sits on top of HTTP. Layers on top of layers...

如果查看SOAP请求,则可以看到两层,其中HTTP头位于顶部,后跟SOAP消息.从 w3schools SOAP教程:

If you look at a SOAP request, you can see both layers, with the HTTP headers at the top, followed by the SOAP message. From the w3schools SOAP tutorial:

---------  HTTP portion of the message ------ 
POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

---------  SOAP portion of the message ------ 
<?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>

为您提供更多阅读内容:

More reading for you:

  • http://en.wikipedia.org/wiki/HTTP
  • http://en.wikipedia.org/wiki/SOAP

这篇关于SOAP和HTTP协议之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆