开发者

Are REST and SOAP enemies? [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 12 years ago.

Nowadays, REST is very popular on web community. So that I am curious to know these two questions.

  1. Are SOAP and REST enemies?
  2. Which one is better and why?


They are not enemies, as they are for different purposes. REST is for lightweight communications, when you need a webservice attending a high number of petitions from a high number of clients, and you don´t need the server keep a state in the communication with each client.

SOAP on the other hand is more heavywieght, but includes some features not present in REST, like keeping a state, handling security, etc.

So each one will be better depending on the scenario.


REST is an architecture. SOAP is a protocol.
The main difference between the two is that REST utilizes the current protocol to perform it's actions and expose services to the clients. In case of the web this is HTTP but it can be used with any other protocol.
In fact SOAP in it's later and less common versions adopts some RESTful qualities (such as using HTTP Verbs instead of re-defining them at the envelope level).

[shameless-promotion]
I recommend you to take look at my presentation about web services. Also take a look at my question here that explains the difference between REST and RPC (SOAP is some form of RPC)
[/shameless-promotion]

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜