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

查看:36
本文介绍了为什么 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 的某些方面(主要是 URL 和方法的 RESTful 使用,例如 PUT/customers/1234GET/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() 在众所周知的端口上建立连接意味着服务存在)等

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天全站免登陆