Difference between REST and SOAP
#
|
SOAP
|
REST
|
1.
|
XML
based message protocol
|
Architectural
style Protocol
|
2.
|
Uses
WSDL for Communication
|
Uses
XML or JSON
|
3.
|
Transport
Independent
***Since SOAP messages are wrapped inside a SOAP envelop it can
be sent over to any transport mechanism e.g. TCP, FTP, SMTP or any other
protocol
|
Transport
Dependent
***RESTful web services are heavily dependent upon HTTP
protocol.
|
4.
|
SOAP web service can return response with only XML
|
RESTful web service can return response in various format e.g.
JSON, XML and HTML
|
5.
|
Difficult
to call from Javascript
|
Easy
to call from JavaScript
|
6.
|
SOAP messages consumes more bandwidth
|
Rest
consumes less bandwidth
*** Because RESTFul services utilizes HTTP header.
|
7.
|
SOAP web services totally ignore web caching mechanism.
|
RESTful web service take full advantage of web caching mechanism
because they are basically URL based
|
8.
|
Security in SOAP based web services need additional
infrastructure in web to enable message or transport level security concerns.
|
Security in RESTful web service can be implemented using
standard and traditional solutions for authorised access to certain web
resources
|
9.
|
SOAP Stands for Simple Object Access Protocol (SOAP).
|
REST stands for REpresentational State Transfer (REST)
|
***Jain