Are there any thumb-rules to decide between two schools of thought: SOAP and REST?
4 Answers
It depends on a lot of factors. One is not better than the other. Here is a list of differences I wrote before.

- 1
- 1

- 339,232
- 124
- 596
- 636
This isn't "thumb rules", but David Chappell gave a fantastic presentation on SOAP vs. REST at the ESRI DevSummit keynote this year. If you've got some time, I highly recommend listening to it.

- 115,835
- 26
- 236
- 269
Here's one: if you don't have any use for other means of transport than HTTP, REST will probably be the better choice.

- 11,323
- 4
- 40
- 61
First of all, while SOAP is specifically a web-oriented technology, REST has nothing to do with HTTP, but is still well-suited for web services. REST is also an architecture rather than a protocol, which SOAP is. So there are many ways to implement a RESTful service, as long as they adhere to the architecture's constraints.
REST fits much better into the traditional HTTP stack since it demands correct usage of protocols, when possible. SOAP merely uses HTTP as a sort of wrapper/proxy around its own protocol, which is not what HTTP is intended for. SOAP tries to get around limitations of HTTP, but it doesn't take advantage of much of what HTTP has to offer.
For example, cache servers sitting in the middle of a client and the content server should be able to cache requests and responses without understanding anything about the contents of each, which is not possible with SOAP, since the actual content that needs to be cached is a subset of the HTTP message's content, inside a bunch of SOAP wrappers and proprietary structure. RESTful services don't have this issue, so they scale much more naturally.
For the best source of information on REST, read Fielding's dissertation, and his blog, where he clears up common misconceptions. (He's the guy that created the REST specifications)

- 15,225
- 5
- 36
- 45
-
-1: "fits better into the traditional HTTP stack since it demands correct usage" - what does fit have to do with anything, and how would demanding correct usage accomplish it? SOAP uses HTTP as one of many possible transports, a concept that should be familiar to anyone who understands layered network protocols. Why should SOAP care about taking advantage of what HTTP has to offer? It's a _protocol_. I expect you'll only be caching GET requests and responses? What "proprietary structure"? – John Saunders Jul 23 '09 at 10:01
-
1SOAP requires POST which is defined to be uncachable. The use of the same URI for many purposes in SOAP also hinders cachcability. – aehlke Jul 23 '09 at 14:07