Monday, February 15, 2010

REST vs SOAP XML WebServices

In a discussion with my friend and I gave him a big technical introduction of how we were using Xml Webservices as our enterprise platform in our company.
He came up with a query for which I did not have any answer.

He enquired whether we were using REST Webservices or not?

I came back defeated and battered and here is what I found out during my followup on the technology and I though I should put up here.

Regarding REST Web Service?

REST stands for Representational state transfer where
1. Each operation in a service is uniquely identified.
2. Each operation has their, own unique URI and can be accessed via this URL all across the web.
3. Each URL is an object representation.
4. The Object can retreived using HTTP GET.
5. The Object can be deleted using a POST or PUT, use DELETE to modify the object


It also happens that Yahoo web services use REST, including Flickr, del.icio.us API uses it, pubsub, bloglines, technorati.

EBay and Amazon have web services for both REST and SOAP.


Google use SOAP web services only, except that Blogger uses XML-RPC. Of course our company uses SOAP too :)

REST vs SOAP

REST api's are a new development and most the big player apis have mostly come out this year.
So REST is definitely the latest 'COOL' way to create a web service.

The main advantages of REST web services are:
* Lightweight - not a lot of extra xml markup
* Human Readable Results
* Easy to build - no toolkits required

SOAP also has some advantages:

* Easy to consume - sometimes
* Rigid - type checking, adheres to a contract
* Development tools available at hand.

No comments:

Post a Comment