Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

REST vs SOAP

 
Krishna Natarajan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I read that REST is another standard like SOAP, but is much easier to code. Could you please summarize the differences and when to which.

Thanks
 
Sam Ruby
author
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
REST is what you used to POST your comment on javaranch, and what you are using now to GET my response.

In web terms, SOAP is an protocol designed to be invisible to the web, you can't simply copy/paste a SOAP URL into an IM session or into a mashup.

Which is easier to program to depends on what tools you are using. In some environments, producing a WSDL file is a mouse click, and consuming that same WSDL file is another mouse click.

The downside is that such interfaces tend to be brittle, and often end up being inadvertently vendor specific -- due to the wide variety of options that WSDL supports, and the various subsets that each individual vendor choses to implement.

By contrast, coding methods like GET and POST are just about as easy in pretty much every programming language with the right toolkit; but they don't parse the datastream. What we have found is that using tools for parsing html or using XPATH does the job in most cases, and doesn't create inadvertent vendor lockin issues and keeps your code resilient from most data format changes.
 
Zander Sinner
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Krishna Natarajan wrote:Hi,
I read that REST is another standard like SOAP, but is much easier to code. Could you please summarize the differences and when to which.

Thanks

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



via SOAP vs. REST
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic