Friday, August 21, 2020

What are the differences between REST and SOAP?

 

  1. SOAP stands for Simple Object Access Protocol whereas REST stands for Representational State Transfer.
  2. The SOAP is an XML based protocol whereas REST is not a protocol but it is an architectural pattern i.e. resource-based architecture.                         
  3. SOAP has specifications for both stateless and state-full implementation whereas REST is completely stateless.
  4. SOAP enforces message format as XML whereas REST does not enforce message format as XML or JSON.
  5. The SOAP message consists of an envelope which includes SOAP headers and body to store the actual information we want to send whereas REST uses the HTTP build-in headers (with a variety of media-types) to store the information and uses the HTTP GET, POST, PUT and DELETE  methods to perform CRUD operations.
  6. SOAP uses interfaces and named operations to expose the service whereas to expose resources (service) REST uses URI and methods like (GET, PUT, POST, DELETE).

  7. SOAP Performance is slow as compared to REST.