Simple Object Access Protocol
is a defined protocol used for communication. It is a protocol that defines a
set of rules for communication using XML-based messaging.
REpresentational State Transfer is not
based on any protocol but has a standard architecture principle used to send
data over standard protocols (HTTP).
SOAP Works purely on XML based, while REST supports JSON,
XML, Microformats etc.
SOAP Doesn’t support Error Handling, while REST has built in
Error handling.
SOAP requires standard tools with middle ware support while
REST doesn’t require any standard tools but requires a standard URI for data
transfer.
SOAP is a heavy weight protocol but a distinct advantage is
its language, platform and most importantly it is transport protocol
independent while REST is light-weight architecture.
SOAP is compatible and secure; this ensures SOAP services are
not blocked firewall while REST is fast and efficient but with a disadvantage
of web caching.
SOAP is used widely for asynchronous processing of
information over the internet while REST is a stateless protocol.
Implementing REST for complex applications can sometimes be
very difficult. This is basically because you need to implement all the major
components like security, transaction, and addressing separately. SOAP is
always an intelligent choice with increasing complexity. Also, SOAP is the best
option when the application is based on internal API’s and the communication
between the server-client is minimal. However, if the application is for developing
third-party API’s or public API’s REST seems to be a better and efficient
option.