Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Similarities and Difference between SOAP and REST

In this article, we will try to understand what SOAP and Rest Services are discussing the similarities and differences in between the two. I have tried to consolidate the basic concept to understand what are SOAP and rest services.

Working for the Same Cause - SOAP and Rest both are used to access Web Services.

What do they stand for?

SOAP - Simple Object Access Protocol
REST - REpresentational State Transfer


What do they mean?

SOAP

  • SOAP is a standards-based Web services access protocol.
  • SOAP relies exclusively on XML to provide messaging services.
  • SOAP was developed by Microsoft.
  • SOAP is a standardized format and has defined various standards for messaging, security, metadata exchange specification and so on.
  • SOAP is highly extensible and also flexible enough to use only those standards which are required for the web services. E.g.: for a web service free to public, it is not required to define the security and authentication for web service.
  • SOAP Based Web Services are defined in WSDL(Web Services Description Language)
  • In case of invalid request, SOAP Response provides details of the error with error code, which helps user to identify the error in the request and correct the same.
  • SOAP client is tightly coupled to the server with rigid contract between client and server, Changes in either of client or server side needs to be communicated to counterparty for web services to work.

REST

  • REST uses URL instead of using XML to make request. Since REST uses URL, REST client is more like a browser.
  • REST uses GET, POST, PUT, and DELETE to perform tasks.
  • We can have the response in required format for e.g. in CSV, JSON, plain text, and XML format while using REST 
  • WADL is the REST equivalent of SOAP's Web Services Description Language (WSDL)
  • REST does not have large number of standards like SOAP.
  • REST is not a protocol but an architectural style.
  • A representation of a resource must be stateless, cacheable.
  • REST requires less bandwidth and resource than SOAP.

SOAP Advantage over REST

  •  REST services inherit security measures from the underlying transport whereas we can define our own security in SOAP. In terms of security, SOAP is assumed to be more safe compared to REST Works well in distributed enterprise environments
  • Is more standardized and has higher extensibility in form of WS* Standard.
  • Allows better error handling in the response from server.


REST Advantage over SOAP

  • REST is protocol independent.
  • While SOAP only supports XML, REST supports different format like text, JSON, XML.
  • REST requires less bandwidth and resource than SOAP.
  • Rest is more lightweight

No comments:

Post a Comment