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

查看:30
本文介绍了为什么必须通过 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.

例如:SMTP、TCP/IP

For example: SMTP, TCP/IP

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

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