Jan 22 2009
SOAP, REST and RPC
Since last 2 years I’ve been using and creating various web-services. I had very basic idea about these and never thought about going into the details. Y’day night I somehow got enthu to digg into it and findout what are best practices, when to use what, differences and other details.. so here are some pointers on what I read..
- SOAP – Simple Object Access Protocol
- REST – Represntational State Transfer
- RPC – Remote Procedure Call
- REST is not simply XML+HTTP, it is valid to anything which conforms to RESTFul principals.
- REST vs RPC = noun vs verb… i.e exchanging resources and concept vs exchaging methods : A good example.
- REST vs SOAP : With SOAP, data exchange takes place with a additional Soap layer. It contains a SoapEnevlop which further contains header and body. With REST the request or response could be in any format, just that it should have a unique resource(URL) and it should specify a valid http method (GET,POST,PUT,DELETE).
- REST : secure, easy to use and light weight.
- REST isn’t best for every case : Sending secured data as params or sending large amount of data could be a problem. In which case you might want to use SOAP.
Further these articles (other then wiki) are worth reading.
- RESTFul service : AjaxPatterns
- RPC Service : AjaxPatterns.
- SOAP specifications by W3C, if you really want to read it. Very detailed – I myself just had a look not yet read it
. - Giving SOAP a REST, i.e. why REST
. - A good tutorial by W3Schools on SOAP, this is definitely worth reading.
