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.



Related Entries

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

Trackbacks

Trackback Address: 431/FC2234D360457253E51737A5E3DB9B23

Comments

On 08/03/2005 at 1:58:50 PM 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 2: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 2: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 2: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 11: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 3: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 12:45:51 PM 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 10: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 10: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 10: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 3: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 8: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 3:39:44 AM EDT KhurramS wrote:
13
Very good article without any focus on blaming one or the other.

On 05/10/2008 at 7: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 10: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 2: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 6: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 3: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 3: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 11: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 4: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 11: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 6: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 6: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.

On 07/25/2010 at 4:54:08 AM EDT ronen h wrote:
25
if i understand right... i understand that SOAP fits to heterogeneous environments such as enterprise SOA since WS* standards enables interoperability, governance and management...

REST on the other hand fits in places where standards is less important is or in homogeneous environment??

On 09/23/2010 at 3:17:06 PM EDT Juergen Brendel wrote:
26
One of the nice advantages of REST is that it supports the idea of multiple representations for resources: HTML if you look at it with a browser, JSON if you access it with a client application, etc.

Someone here asked for a sample REST web service. I would go here: http://3.ly/restxdemo. It demonstrates RESTx - an open source project for the creation of RESTful web services, home page: http://restx.mulesoft.org. RESTx introduces a whole new concept in which RESTful web services can be created and consumed.

On 01/11/2011 at 10:39:54 AM EST Zubaer khan wrote:
27
I'm always surprised when comparisons don't include WSDL as a SOAP advantage. REST has no description language.

On 01/14/2011 at 6:02:26 AM EST topher wrote:
28
I know this article is about 5 years old, but google doesn't use SOAP for its search API any more. The changed to AJAX a while ago, and more recently changed to RESTful JSON/Atom

http://code.google.com/apis/customsearch/v1/overview.html

On 02/18/2011 at 2:11:36 AM EST Sonali wrote:
29
This is a good article to understand the basics. Thanks!

On 06/23/2011 at 8:05:43 AM EDT Jay Khimani wrote:
30
Google uses REST a lot specifically for mobile - Android. Android SDK does not have support for SOAP services. Google uses and recommends REST/JSON based web services

On 08/03/2011 at 11:44:04 AM EDT sameh wrote:
31
This is a good article to understand the basics. Thanks!

On 09/12/2011 at 1:44:15 AM EDT rolandtrv wrote:
32
Things are constantly changing but things somehow remain the same. As the Bible says "There is nothing new under the sun". I'm an old timer the cut my teeth in programming during the old C and C++ days. We were attempting to figure out how to integrate Unix with the Mainframe with all it's different OS's (VM, MVS, CICS, etc). Because the applications had no public API's only menu driven UI's there was the critical need to integrate with these dinosaur applications (and of course there still is for those of you that think the entire software universe is the content within an HTTP payload). IBM of course created LU6.2 which was a peer to peer protocol that enabled data to be transferred a client application and a mainframe application say in CICS. Well they also had what was known as LU2 which was based on what was known as a 3270 presentation space payload that was functionally similar to an HTTP payload. It contained presentation data based on what fields were on the menu screen and what data was fixed or static. It was all accessible and the fields were writeable, and the static or fixed data was readable. Because it was an an old text based screen, everything was based on rows and columns of a two dimensional presentation space. Elemenets of the screen could be found or written to based on rows and columns and pattern matching. The API that did this was called HLLAPI. I implemented the functional library for HLLAPI for IBM'S

On 09/12/2011 at 2:19:52 AM EDT rolandtrv wrote:
33
Some how or another my message from the last one got sent before I finished it. Must'a hit a wrong key or something. Getting OLD! Never the less the API library I implemented for IBM was call HLLAPI for IBM's old RS6000 UNIX workstation called of course AIX. But to make a long story short. LU2, 3270, and HLLAPI were nothing more then what was called at that time SCREEN SCRPERS (I had to leave the 'A' out because the site complained about the word R*PE in it). They had the ability to search and write on the screen. Software written in C and C++ could be written relatively quickly while we waited for LU6.2 to become functional. Again they were quick and relatively easy, but they were some what unreliable because of unforseen or unknown error screens thay could mess up the searching and writing for and to proper fields within the screen (the 3270 payload). Also software written with HLLAPI were subject to whimsical screen changes of the developer who was maintaining the program on the Mainframe side. If any changes to the screen ocurred that were not communicated to those that needed them to be the same would break your software. Today with REST, if you are interfacing with a public application on the web (through the browser) you too are subject to the whimsical changes that web site applications always do. Now of course most of the REST applications that are written by the owners of the web site who insure any REST application dependent on them know the changes so that they can update the REST application. The peer to peer protocol LU6.2 was considered much better because it was easier to maintain changes and was faster. Never the less they were more difficult to develop because they were normally much larger and much more complicated. SOAP web services with WSDLs is more akin to the old LU6.2 because it invokes a service in the cloud that returns data within an XML payload defined by the WSDL. So SOAP web services are more sophisticated (in the backend) and can do more because they directly integrate with the databases and other resources within the cloud. So to say REST should be used over SOAP is a misunderstanding of the functionality of the two types of interfaces. REST does not have direct accessibility with the backend making it a completely different utility then SOAP.

On 02/06/2012 at 11:31:10 AM EST Anonymous wrote:
34
boom boom boom

On 05/25/2012 at 2:57:08 PM EDT Simon wrote:
35
I think there is generally being looked and thought wrongly about the two methods SOAP (Simple Object Access Protocol) and RESTful(REpresentational State Transfer) - web services. The reason REST has gotten so popular is that it has an ALTERNATIVE to what SOAP has to offer when it comes to making web services quick and easy. You can think of the 2 methods like this: -SOAP being a letter made of an envelope(the container), address field(who is to receive the letter) and the body (the contents inside the letter). This means you cant see what is in a SOAP message until opened. -RESTful being a post-it where you write the contents on it and slam it up in the left upper corner of the billboard and tell people about it. Now you can't have one post-it going on top of another, meaning that RESTful web services needs a unique URI(link).

This was just a bit about the subject. The main conclusion is that you should think of REST as an alternative to SOAP, being more easy, faster and less complicated than SOAP is to create. At least that is how it is at the moment. As far as i know, Oracle and Microsoft are trying to come up with a solution...

On 11/16/2012 at 8:10:56 PM EST Liza wrote:
36
Hello there. I was thinking of adding a hyperlink back to your blog since both of our web sites are based around the same subject. Would you prefer I link to you using your site address: http://www.petefreitag.com/item/431.cfm or blog title: REST vs SOAP Web Services. Be sure to let me know at your earliest convenience. Many thanks

http://www.series7examprep.com/the-perks-of-securities-trading-for-a-living/

On 02/25/2013 at 7:37:09 PM EST tom wrote:
37
Im looking to find someone to help me build a program to download patents from the different patent websites loke the USPTO and EPO REST vs SOAP Web Services

tom

On 02/26/2013 at 12:38:38 AM EST joe wrote:
38
tom... we're in the middle of building a tool to download and import patents from uspto.

contact info_at_createtank_dot_com to discuss

On 05/01/2014 at 11:41:37 PM EDT energeticdad wrote:
39
Blogspot blog: How do I get rounded corners for my backgrounds? energeticdad http://energeticdadpage.wallinside.com/

Post a Comment




  



Spell Checker by Foundeo

Recent Entries



foundeo


did you hack my cf?