跟进这个帖子的问题:
现在我对SOAP和RESTful服务之间的差异有一点点了解。
我的问题是当我应该使用SOAP,当我应该使用RESTful; 在性能/速度或请求处理方面哪一个更好?
我在RESTful(java)中第一次实现,我想知道更多关于它; 之前我已经处理了SOAP。
This question already has an answer here:
SOAP vs REST (differences) 10 answersFollow up question to this post:
For now I have a slight idea about the differences between SOAP and RESTful Services.
My question is when I should use SOAP, and when I should use RESTful; which one is "better" when it comes to performance/speed or request handling?
I'm implementing for the first time in RESTful(java) and I want know more about it; I've dealt with SOAP before.
最满意答案
REST几乎总是会更快。 SOAP的主要优点在于它提供了一种服务对客户端自身描述的机制,并且宣传其存在。
REST更轻巧,可以使用几乎任何工具实现,从而降低带宽,缩短学习曲线。 但是,客户必须知道要发送什么以及期待什么。
一般来说,当您向外部世界发布一个复杂或可能发生变化的API时,SOAP将更加有用。 除此之外,REST通常是更好的选择。
REST is almost always going to be faster. The main advantage of SOAP is that it provides a mechanism for services to describe themselves to clients, and to advertise their existence.
REST is much more lightweight and can be implemented using almost any tool, leading to lower bandwidth and shorter learning curve. However, the clients have to know what to send and what to expect.
In general, When you're publishing an API to the outside world that is either complex or likely to change, SOAP will be more useful. Other than that, REST is usually the better option.
更多推荐
发布评论