为什么必须通过HTTP发送SOAP消息? [英] Why does a SOAP message have to be sent over HTTP?

查看:138
本文介绍了为什么必须通过HTTP发送SOAP消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是一个演示SOAP请求消息:

Below is a demo SOAP request message:

HTTP/1.1 200 OK
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn

    <SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
   <SOAP-ENV:Header>
       <t:SessionOrder
         xmlns:t="http://example.com"
         xsi:type="xsd:int" mustUnderstand="1">
           5
       </t:SessionOrder>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
       <GetStockQuote
         xmlns="http://someexample.com">
           <Price>MSFT</Price>
       </GetStockQuote>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

我们可以看到,此SOAP消息的编码方式就好像它是一个网页一样.为什么我们必须使用HTTP协议? SOAP消息只是一些XML,为什么我们不只是使用XML作为信息交换协议并摆脱HTTP标头(因此就不用使用HTTP了).

And we can see, this SOAP message is encoded as if it is a web page. Why do we have to use the HTTP protocol? SOAP message is just some XML, why not we just use XML as the information exchange protocol and get rid of the HTTP headers (thus leave HTTP alone).

非常感谢.

HTTP不是传输级别协议.它只是一个应用程序级协议.它与运输无关.实际上,我的问题是向SOAP消息添加HTTP内容的动机是什么?

HTTP is not a transport level protocol. It is just a application-level protocol. It has nothing to do with transport. Actually, my question is what's the motive of adding HTTP stuff to a SOAP message?

推荐答案

SOAP可以通过不同的传输方式发送. HTTP只是其中之一.

SOAP can be sent over different transports. HTTP is just one of them.

这篇关于为什么必须通过HTTP发送SOAP消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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