Difference between REST and SOAP web services
Key Difference: SOAP stands for Simple Object Access Protocol. SOAP web services are based on SOAP and ws-* specifications. The term Representational State Transfer (REST) has been coined by Roy Fielding. It refers to a web application interface that is implemented by using the concepts and principles of HTTP and REST.
Web service can be defined in many ways. However, to understand it, one can define it as a method that is used for communication between applications or systems. It can be described as a standard based and language agonistic software entity that is capable of accepting formatted requests from other types of entities to generate application specific responses. Web services are application components that communicate by using open protocols. Web services use a standardized HTTP and XML messaging system and therefore are platform independent and language independent.
Web services are classified into two types: Simple Object Access Protocol (SOAP) and Representational State Transfer (REST).
SOAP web services are based on SOAP and ws-* specifications. It makes use of the WS-Trust to acquire the security tokens. It is based on the standards. These web services are object oriented. SOAP is basically a protocol specification that is used to exchange the structured information during the implementation of web services. It employs XML for the message format. SOAP is supported by the Web Services Interoperability Organization (WS-I). SOAP has been able to take care of aspects like security and addressing, through its internal implementation of SOAP protocol.
The term Representational State Transfer (REST) has been coined by Roy Fielding to identify an architectural style that works on the principles of designing network-based software architectures. REST has no WSDL interface definition. REST Web services are based on the principles of REST, according to which, every resource is recognized with a URI. In response to HTTP messages, resources return their representations to clients. In another case, the clients can also make some changes in the resources. These services are representation oriented. They lack any of the standards to describe the services.
Comparison between REST and SOAP Web Services:
|
REST Web Services |
SOAP Web Services |
Abbreviation |
Representational State Transfer |
Simple Object Access Protocol |
Standard |
No standard |
Declarative (standard WSDL is used) |
Support |
Numerous content types |
Only XML |
Reliability |
Application specific |
WS- Reliable messaging |
Caching |
Get operations can be cached if desired. |
No |
Size of message |
Lightweight |
Comparatively heavy |
Implementation |
Simple |
Complex |
Application areas |
Limited bandwidth and resources Totally stateless operations Caching situations |
Asynchronous processing and invocation Formal contracts Stateful operations |
Developer view |
Resource oriented |
Object oriented |
Transport protocol support |
HTTP |
HTTP, SMTP, JMS |
Images Courtesy: wordpress.com
Add new comment