Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

when should REST be used instead of SOAP and when it should not be used instead of SOAP?  RSS feed

 
Monica Shiralkar
Ranch Hand
Posts: 886
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read the differences between REST and SOAP everywhere. But practically when should REST be used instead of SOAP and when it should not be used instead of SOAP?

thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My usual answer is that you should only use SOAP when you need the "WS-*" security related functions such as encryption, authentication, etc etc.

Keep in mind the SOAP is a formally specified messaging API independent of transport method while REST is an architectural style requiring strict use of HTTP.

Bill
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Complementing the answer from William with SOAP based web services usually you have a public contract/interface, the wsdl file.
This file describes the functionalities provided by the service, with REST services you have to relay on the convention and in the documentation of the service (where available).

Best regards,
 
Monica Shiralkar
Ranch Hand
Posts: 886
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all. Does that mean one can conclude the below:

- There is nothing which REST can do but SOAP can not whereas viceversa is true..

- Only advantage of REST over SOAP is easy of development.From technology perspective there is no advantage.Only that less coding effort is required.


Please confirm whether my understanding is corret.


Thanks..
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, neither of those would be correct. William pointed out two areas where SOAP has capabilities that REST does not: Security and support for non-HTTP transport.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Only advantage of REST over SOAP is easy of development.From technology perspective there is no advantage.Only that less coding effort is required


Wrong! RESTful style will always be faster to deliver responses to the client, simply because it skips all the SOAP message XML creation and parsing.

Much faster to analyze a request and much faster to send a response! Using much less server memory and CPU time.

Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!