• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference between Rest and SOAP?

 
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually i have tried to find out the difference between SOAP and REST. I understood upto some extent, but was not able to understand/visualise the differences in real time scenarios.

I have few question based on things i read:

1)book says Use soap when architecture must address complex non functional requirement.(eg transaction,security etc)
My question on above Does that mean SOAP is used when we need more security? For eg banking trasnactions and all? Also what about security in REST.Are REST less secure?

2)an article saysRest services provide more scalablity and are much faster.The reason what they say is that with SOAP messages,Intermediate Servers will use SOAP's header's body,and each intermediate server will manipulate SOAP message, update soap header etc, therefore SOAP are slower than REST
My question on aboveWhy dont this happen for REST services,i mean why intermediate servers dont manipulate REST message

3) Finally, if REST is always better than SOAP, will we ever need SOAP in future projects?


 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. REST is an architectural style based on simple rules for how you use HTTP, SOAP is a much more complex and restrictive architecture with a huge set of (sometimes optional) rules capable of creating high level of security at the cost of complex programming. Any security in REST you will have to invent for your application.

2. True - RESTful services are intrinsically faster. Again, any multiple intermediate architecture you want in REST you will have to do yourself.

As per many many articles on the topic SOAP has its place and is unlikely to go away. IMHO most of what people think of as web services can be done better in a RESTful architecture.

Bill



 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

2)an article saysRest services provide more scalablity and are much faster.The reason what they say is that with SOAP messages,Intermediate Servers will use SOAP's header's body,and each intermediate server will manipulate SOAP message, update soap header etc, therefore SOAP are slower than REST
My question on aboveWhy dont this happen for REST services,i mean why intermediate servers dont manipulate REST message



Thanks William for your response.Now 1) is clear to me. But am not sure about 2).

I mean (w.r.t 2) why do we need to have intermediate nodes process SOAP message.Why not the ultimate receiver process the entire SOAP message(if that speeds up the SOAP services)?Whats the purpose of these intermediate nodes in real time scenarios?Could you please help me with this.

Thanks in advance!
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah yessss - the intermediate node notion.

In my opinion - the creators of much of the SOAP additions to the basic concept got carried away and created things for which there was practically no demand. Don't worry about it, you will run into this sort of thing all the time in computing. For example, UDDI never really took off. Some stuff gets used in practice and some gets ignored.

That is what is so appealing about the RESTful architecture notion.

Bill
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another way to look at is that REST uses HTTP as an API, while SOAP simply uses it as a transport mechanism.
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks William and Bibeault.
But now there another question arises from Bibeault's reply.

Another way to look at is that REST uses HTTP as an API, while SOAP simply uses it as a transport mechanism.



SOAP uses it as a transport mechanism...I agree, but
REST uses HTTP as an API.... what does this mean now?(HTTP is a application layer protocol right)


Thanks in advance
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rather than just using HTTP to carry information, the methods (GET, PUT, DELETE, et al) are used to convey the API itself.

Wikipedia can likely do a better job at explaining it than I: Representational State Transfer

 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rather than just using HTTP to carry information, the methods (GET, PUT, DELETE, et al) are used to convey the API itself.



I got it now..

Thanks
 
Greenhorn
Posts: 15
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Read this article on to understand the differences between Rest and SOAP. REST and SOAP - Web Services Analogy - REST vs SOAP.

Cheers
 
reply
    Bookmark Topic Watch Topic
  • New Topic