为什么HTTP / SOAP被认为是“厚”的? [英] Why Is HTTP/SOAP considered to be "thick"

查看:116
本文介绍了为什么HTTP / SOAP被认为是“厚”的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说过SOAP / HTTP Web服务调用堆栈厚或重量级的一些观点,但我无法确定原因。由于SOAP信封和消息的序列化/反序列化,它会被认为是厚的吗?这真的是一个重量级的操作吗?

I've heard some opinions that the SOAP/HTTP web service call stack is "thick" or "heavyweight," but I can't really pinpoint why. Would it be considered thick because of the serialization/deserialization of the SOAP envelope and the message? Is that really a heavy-weight operation?

或者与固定连接上的原始/二进制数据传输相比,它只被认为是厚吗?

Or is it just considered "thick" compared to a raw/binary data transfer over a fixed connection?

还是其他原因?任何人都可以对此有所了解吗?

Or is it some other reason? Can anyone shed some light on this?

推荐答案

SOAP的设计足够抽象,可以使用除HTTP之外的其他传输。这意味着,除其他外,它利用HTTP的某些方面(主要是REST和URL和方法的使用,例如 PUT / customers / 1234 GET / customers / 1234 )。

SOAP is designed to be abstract enough to use other transports besides HTTP. That means, among other things, that it does not take advantage of certain aspects of HTTP (mostly RESTful usage of URLs and methods, e.g. PUT /customers/1234 or GET /customers/1234).

SOAP还绕过现有的TCP / IP机制原因 - 与运输无关。同样,这意味着它无法利用传输,例如序列管理,流量控制,服务发现(例如 accept()在众所周知的连接上port表示服务存在)等。

SOAP also bypasses existing TCP/IP mechanisms for the same reason - to be transport-independent. Again, this means it can't take advantage of the transport, such as sequence management, flow control, service discovery (e.g. accept()ing a connection on a well-known port means the service exists), etc.

SOAP使用XML进行所有序列化 - 虽然这意味着数据只有XML解析器才能普遍可读,它介绍了如此多的样板,你真的需要一个SOAP解析器才能有效地运行。此时,您(作为软件消费者)已经失去了XML的好处;如果你需要 libSOAP 来处理它,那么谁会关心有效载荷的样子。

SOAP uses XML for all of its serialization - while that means that data is "universally readable" with just an XML parser, it introduces so much boilerplate that you really need a SOAP parser in order to function efficiently. And at that point, you (as a software consumer) have lost the benefit of XML anyways; who cares what the payload looks like over the wire if you need libSOAP to handle it anyways.

SOAP需要WSDL为了描述接口。 WSDL本身不是问题,但它往往被宣传为比实际更动态。在许多情况下,创建单个WSDL,并从中自动生成生产者/消费者代码,并且它永远不会更改。总的来说,这需要大量的工具,而不是真正解决原始问题(如何在不同服务器之间进行通信)。由于大多数SOAP服务都是通过HTTP运行的,因此最初的问题已经主要解决了。

SOAP requires WSDL in order to describe interfaces. The WSDL itself isn't a problem, but it tends to be advertised as much more "dynamic" than it really is. In many cases, a single WSDL is created, and producer/consumer code is auto-generated from that, and it never changes. Overall, that requires a lot of tooling around without actually solving the original problem (how to communicate between different servers) any better. And since most SOAP services run over HTTP, the original problem was already mostly solved to begin with.

这篇关于为什么HTTP / SOAP被认为是“厚”的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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