Question
CVS CareMark
CVS CareMark
US
CVS CareMark
Posted: Jul 28, 2015
Last activity: Aug 12, 2015
Last activity: 12 Aug 2015 12:40 EDT
Closed
Solved
SOAP - REST- Stored Proc
I keep hearing lot of discussions about When , Where and Best to use the SOAP , REST and Stored procedure. Could some explain me the reasons which protocol is the best?
Appreciate if we can have the differences?
Thanks,
Suman
SOAP is a structured messaging protocol. It follows a standard structure and a typical message would have a header,body and an encompassing envelope.
SOAP is more oriented towards a Remote procedure call approach for e.g. if you are writing a method and want to expose that operation as a webservice
There are numerous specifications around SOAP protocol which lets you do many things for e.g.
Securely transfer the message - WS-Security,Ws-Policy
MTOM- Sending inline images in soap payload more efficiently
SWA- SOAP with attachments
Ws-Reliable Messaging
Ws-Addressing
The most important benefit in soap is if you want a asynchronous and stateful behaviour , the SOAP protocol may have an edge over REST.
On the other hand REST is simply an architectural style and not a protocol, it is rapidly gaining popularity in the API world
REST is very easy to understand and is extremely approachable, but does lack standards and is considered an architectural approach. In comparison, SOAP is an industry standard with a well-defined protocol and a set of well-established rules to be implemented, and it has been used in systems both big and small.
REST is best suited for the following
If you want complete statelessness
you want to exchange data using JSON.remember we dont exchange messages in SOAP using JSON, it is XML.
SOAP is a structured messaging protocol. It follows a standard structure and a typical message would have a header,body and an encompassing envelope.
SOAP is more oriented towards a Remote procedure call approach for e.g. if you are writing a method and want to expose that operation as a webservice
There are numerous specifications around SOAP protocol which lets you do many things for e.g.
Securely transfer the message - WS-Security,Ws-Policy
MTOM- Sending inline images in soap payload more efficiently
SWA- SOAP with attachments
Ws-Reliable Messaging
Ws-Addressing
The most important benefit in soap is if you want a asynchronous and stateful behaviour , the SOAP protocol may have an edge over REST.
On the other hand REST is simply an architectural style and not a protocol, it is rapidly gaining popularity in the API world
REST is very easy to understand and is extremely approachable, but does lack standards and is considered an architectural approach. In comparison, SOAP is an industry standard with a well-defined protocol and a set of well-established rules to be implemented, and it has been used in systems both big and small.
REST is best suited for the following
If you want complete statelessness
you want to exchange data using JSON.remember we dont exchange messages in SOAP using JSON, it is XML.
SOAP can become quite complex as it is based on schema to represent the service data model and as schema is object oriented, it may be difficult to understand .
Parsing overhead of SOAP messages may be more than rest messages as SOAP messages structure can be complex as it involves many things around it for e.g. security.
So bottomline is if you want to build an api driven app, go with RESt without a second thought, it is lightweight and past and often supports all the http operations like GET,POST,PUT and delete.
For SOAP it is often a HTTP POST.
Why is stored procedures compared with REST and SOAP? Its purely a database concept and used to speed up query execution time.I am not sure whats the intent here?