开发者

REST vs SOAP Web Services [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

I am seeing a lot of new web services are implemented using a REST style architecture these days rather than a SOAP one.

what is the difference开发者_Go百科?


There is no such thing as one being better, they are different and what is better depends on your needs.

If you need a lot of standards based functionality with relatively rich clients SOAP will deliver that. It gives thinks like metadata, WSDL, security or reliable messaging to name but a few through the WS-* specs. It is also transport agnostic and completely XML centric.The flip side of the coin is that there is a big standard that is not always implemented in an interopable fashion.

REST on the other hand is all about HTTP and its way of doing things. Very flexible and allows any kind of data format you like. So not just XML but also SOAP, images or VCards to name a few. It embraces the web standards so will work with almost any programming stack. The flip side is far fewer standards so it can be much harder to figure out how to do something.


An advantage of REST over SOAP is that the action is specified by the HTTP method and by the URL, this means that fewer bytes have to be sent as compared to SOAP which relies on verbose XML. And fewer bytes means less latency; therefore, I would recommend using REST instead of SOAP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜