Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between Rest and SOAP?

 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • 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?


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • 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
  • 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
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64606
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64606
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Manish Chhabra
Greenhorn
Posts: 15
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic