aspose file tools*
The moose likes Web Services and the fly likes Difference between Rest and SOAP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Difference between Rest and SOAP?" Watch "Difference between Rest and SOAP?" New topic
Author

Difference between Rest and SOAP?

Maan Suraj
Ranch Hand

Joined: Dec 20, 2007
Posts: 299
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?



Man Suraj
Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
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

Joined: Dec 20, 2007
Posts: 299
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

Joined: Mar 22, 2000
Posts: 12806
    
    5
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

Joined: Jan 10, 2002
Posts: 61432
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Maan Suraj
Ranch Hand

Joined: Dec 20, 2007
Posts: 299
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

Joined: Jan 10, 2002
Posts: 61432
    
  67

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

Joined: Dec 20, 2007
Posts: 299
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

Joined: Feb 24, 2010
Posts: 15


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

Cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between Rest and SOAP?