XML-RPC 和 SOAP 之间有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/80112/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's the difference between XML-RPC and SOAP?
提问by Scott Saad
I've never really understand why a web service implementer would choose one over the other. Is XML-RPC generally found in older systems? Any help in understanding this would be greatly appreciated.
我从来没有真正理解为什么 Web 服务实现者会选择一个而不是另一个。XML-RPC 通常存在于较旧的系统中吗?任何帮助理解这一点将不胜感激。
回答by Christopher Mahan
Differences?
差异?
SOAP is more powerful, and is much preferred by software tool vendors (MSFT .NET, Java Enterprise edition, that sort of things).
SOAP 更强大,更受软件工具供应商(MSFT .NET、Java 企业版等)的青睐。
SOAP was for a long time (2001-2007ish) seen as the protocol of choice for SOA. xml-rpc not so much. REST is the new SOA darling, although it's not a protocol.
SOAP 长期以来(2001-2007 年)被视为 SOA 的首选协议。xml-rpc 没有那么多。REST 是 SOA 的新宠,尽管它不是协议。
SOAP is more verbose, but more capable.
SOAP 更冗长,但功能更强大。
SOAP is not supported in some of the older stuff. For example, no SOAP libs for classic ASP (that I could find).
一些较旧的东西不支持 SOAP。例如,没有经典 ASP 的 SOAP 库(我可以找到)。
SOAP is not well supported in python. XML-RPC has great support in python, in the standard library.
SOAP 在 python 中没有得到很好的支持。XML-RPC 在 python 中,在标准库中有很大的支持。
SOAP supports document-level transfer, whereas xml-rpc is more about values transfer, although it can transfer structures such as structs, lists, etc.
SOAP 支持文档级传输,而 xml-rpc 更多的是关于值的传输,虽然它可以传输诸如结构、列表等结构。
xm-rpc is really about program to program language agnostic transfer. It primarily goes over http/https. SOAP messages can go over email as well.
xm-rpc 实际上是关于程序到程序语言的不可知转移。它主要通过 http/https。SOAP 消息也可以通过电子邮件。
xml-rpc is more unixy. It lets you do things simply, and when you know what you're doing, it's very fast to deploy quality web services, even when using terminal text editors. Doing SOAP that way is a zoo; you really need a good IDE to make it feasible.
xml-rpc 更加 unixy。它让您可以简单地做事,当您知道自己在做什么时,即使使用终端文本编辑器,也可以非常快速地部署高质量的 Web 服务。以这种方式执行 SOAP 是一个动物园;你真的需要一个好的 IDE 来使它可行。
Knowing SOAP, though, will look much better on your resume/CV if you're vying for a Fortune 500 IT job.
但是,如果您正在争夺财富 500 强 IT 工作,那么了解 SOAP 会在您的简历/简历上看起来好得多。
xml-rpc has some issues with non-ascii character sets.
xml-rpc 有一些非 ascii 字符集的问题。
XML-RPC does not support named parameters. They must be in correct order. Not sure about SOAP, but think so.
XML-RPC 不支持命名参数。它们的顺序必须正确。对 SOAP 不确定,但可以这么认为。
回答by bmdhacks
Just to add to the other answers, I would encourage you to look at actual textual representations of SOAP and XML-RPC calls, perhaps by capturing one with Ethereal. The whole, "XML-RPC is simpler" argument doesn't make much sense until you see how incredibly verbose a SOAP call is. Many of the fairly popular web sites out there shy away from SOAP as their API due to just the amount of bandwidth it would consume if people started using it extensively.
只是为了补充其他答案,我鼓励您查看 SOAP 和 XML-RPC 调用的实际文本表示,也许通过使用 Ethereal 捕获一个。整个“XML-RPC 更简单”的论点没有多大意义,直到您看到 SOAP 调用是多么令人难以置信的冗长。许多相当流行的网站都回避使用 SOAP 作为它们的 API,因为如果人们开始广泛使用它会消耗大量带宽。
回答by Dexter
Kate Rhodes has a great essay on the differences at http://weblog.masukomi.org/2006/11/21/xml-rpc-vs-soap
Kate Rhodes 在http://weblog.masukomi.org/2006/11/21/xml-rpc-vs-soap上有一篇关于差异的精彩文章

