Nowadays, REST is very popular on web community. So that I am curious to know these two questions.<ol><li>Are SOAP and REST enemies?</li> <li>Which one is better and why?</li> </ol>Answer1:
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.Answer2:
REST is an architecture. SOAP is a protocol.<br /> 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.<br /> 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]<br /> I recommend you to take look at <a href="http://www.slideshare.net/the_drow/communication-protocols-and-web-services" rel="nofollow">my presentation</a> about web services. Also take a look at <a href="https://stackoverflow.com/questions/1098473/rest-vs-rpc" rel="nofollow">my question here</a> that explains the difference between REST and RPC (SOAP is some form of RPC)<br /> [/shameless-promotion]