REST vs SOAP Web Services

web

I am seeing a lot of new web services are implemented using a REST style architecture these days rather than a SOAP one. Lets step back a second and explain what REST is.

What is a REST Web Service

The acronym REST stands for Representational State Transfer, this basically means that each unique URL is a representation of some object. You can get the contents of that object using an HTTP GET, to delete it, you then might use a POST, PUT, or DELETE to modify the object (in practice most of the services use a POST for this).

Who's using REST?

All of Yahoo's web services use REST, including Flickr, del.icio.us API uses it, pubsub, bloglines, technorati, and both eBay, and Amazon have web services for both REST and SOAP.

Who's using SOAP?

Google seams to be consistent in implementing their web services to use SOAP, with the exception of Blogger, which uses XML-RPC. You will find SOAP web services in lots of enterprise software as well.

REST vs SOAP

As you may have noticed the companies I mentioned that are using REST api's haven't been around for very long, and their apis came out this year mostly. So REST is definitely the trendy way to create a web service, if creating web services could ever be trendy (lets face it you use soap to wash, and you rest when your tired). 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

For consuming web services, its sometimes a toss up between which is easier. For instance Google's AdWords web service is really hard to consume (in CF anyways), it uses SOAP headers, and a number of other things that make it kind of difficult. On the converse, Amazon's REST web service can sometimes be tricky to parse because it can be highly nested, and the result schema can vary quite a bit based on what you search for.

Which ever architecture you choose make sure its easy for developers to access it, and well documented.


cfobjective pre-conf training

Related Entries

41 people found this page useful, what do you think?

WAF for CF

Trackbacks

Trackback Address: 431/FC2234D360457253E51737A5E3DB9B23

Comments

On 08/03/2005 at 11:58:50 AM EDT Patrick wrote:
1
I think in your REST vs SOAP section you meant that the first list was advantages of REST, not SOAP. Otherwise, great overview of the two technologies.

I would add as an advantage of REST, though, that it's built "closer" conceptually to existing technologies, so in my experience it's more hackable in the sense of combining disparate parts together in innovative ways.

On 08/03/2005 at 12:01:34 PM EDT Ken Kolano wrote:
2
Do you mean to say... "The main advantages of REST web services are:"?

On 08/03/2005 at 12:38:08 PM EDT Pete Freitag wrote:
3
Patrick, and Ken - yes I meant to say REST not SOAP. I have edited the entry. Thanks!

On 08/03/2005 at 12:40:17 PM EDT Pete Freitag wrote:
4
I don't want to edit this entry again, but I should have mentioned PayPal as another big user for SOAP, their new web services use SOAP.

On 07/21/2006 at 9:18:06 AM EDT Luis wrote:
5
Is there an example of an implementation of a web service using cf7 using rest. I can't seem to find one. I need to expose a web service that will allow for HTTP POST AND GET for consuming.

Thanks -Luis

On 07/17/2007 at 1:49:40 AM EDT Rogelio Carrillo Jr. wrote:
6
I like much on the concept of REST, but can you list a URL that has sample web service implementation using REST.

On 10/17/2007 at 10:45:51 AM EDT Ben wrote:
7
Would anyone have a connection/s with any person practicing this technology in the MN twin cities area?

On 11/20/2007 at 8:28:13 AM EST JZ wrote:
8
I am an enterprise architect and soa-integration practitioner currently working in MN for a client's transformation from web 1.0 to web 2.0 in which a hybrid Rest Web Services and SOAP services are architectured in two front - web site activites (REST) and (SOAP) enterprise applications interation (EAI) to enterprise information integration (EII)

On 01/14/2008 at 8:19:31 PM EST imei wrote:
9
Where can I find tutorial or complete sample code to build REST WebServices in C#?

On 02/08/2008 at 8:02:21 PM EST Lahiru Gunathilake wrote:
10
I think no need to have a competition between REST and SOAP.If you use Apache Axis2c you can use both.When you see some service which is reliable with REST you can use REST and if you see any advantage with SOAP you can use SOAP.

On 04/04/2008 at 1:01:46 PM EDT Craig Conover wrote:
11
Yes, this was a nice overview of the two Web Service types. If you are interested in creating AJAX applications (simple and fast) WaveMaker will consume either of them and are equally easy to wire up to your widgets visually.

On 04/28/2008 at 6:30:08 AM EDT sameh wrote:
12
i want an exaple how i make the hit to service in retrieving the response ...

On 05/02/2008 at 1:39:44 AM EDT KhurramS wrote:
13
Very good article without any focus on blaming one or the other.

On 05/10/2008 at 5:56:00 PM EDT mawandm wrote:
14
I've been using XML-RPC for quite sometime simply because its quite simple to use. Where would you place it vs REST vs SOAP

On 06/20/2008 at 8:48:46 AM EDT BiraRai wrote:
15
Around 1996 CGI scripting was all the rage. A lot of the concepts in RESTful web services are being repeating now. I implemented a RESTful web service 13 years ago using CGI scripting and handled the back-end processing using PERL. RESTful web services are a new name for a old concept.

On 07/22/2008 at 12:50:57 PM EDT Ed Swindelles wrote:
16
I've created an article series on my blog about creating REST web services in C#: http://www.swindelles.com/ed/2008/07/11/creating-rest-web-services-in-c-sharp/

On 10/31/2008 at 4:21:39 AM EDT Rodrigo wrote:
17
BiraRai you are a genious! you should get the patent for REST. http://www.rodrigoasensio.com

On 03/03/2009 at 1:01:20 PM EST Vishal wrote:
18
Follow this link for more information regarding RESE with C#: http://softwareprogramminghelp.blogspot.com/

On 03/03/2009 at 1:01:43 PM EST Vishal wrote:
19
Follow this link for more information regarding RESE with C#: http://softwareprogramminghelp.blogspot.com/

On 05/03/2009 at 9:50:26 PM EDT Vijith wrote:
20
Great article Pete. It gives nice overview of both REST and SOAP WS.

And thnx Ed for the article on creating REST WS in C#

On 08/05/2009 at 2:57:24 PM EDT Todd wrote:
21
I'm always surprised when comparisons don't include WSDL as a SOAP advantage. REST has no description language.

On 09/02/2009 at 9:04:37 AM EDT prashant wrote:
22
Need help to take decision to use soap or rest for java and .net application with mysql database. From .net application request java web service to connect mysql and proceed response and all other request To java web service from .net UI. Please sent me tutorials if you have.

On 10/27/2009 at 4:25:44 PM EDT j03 wrote:
23
Todd... REST does have a description language options - HTML Form, WSDL 2.0, or WADL.

See: http://createtank.com/2009/02/a-web-service-description-for-rest/ http://www.ibm.com/developerworks/webservices/library/ws-restwsdl/ http://plasmasturm.org/log/460/ http://en.wikipedia.org/wiki/XForms#XForms_as_part_of_the_XRX_Application_Architecture

On 12/21/2009 at 4:56:45 AM EST kodegeek wrote:
24
what about xml-rpc? you should compare these three to give us basic differences. I heard, xml-rpc is easier for small job. Great article indeed.

Post a Comment




  



Spell Checker by Foundeo

Recent Entries





Basecamp
pfreitag on twitter