REST Service Overview

What is REST?

  • REST stand for Representational State Transfer.

  • REST is an architecture style for designing networked applications.

  • REST relies on a stateless, client-server, cacheable communications protocol.

  • REST uses HTTP for all four CRUD (CREATE/READ/UPDATE/DELETE) operations.

  • REST is a lightweight alternative to mechanisms like RPC (Remote Procedure Calls) and Web Services (SOAP, WSDL, et al.).

Why REST is lightweight compare to SOAP?

IF we do any request in REST service, let’s suppose we want to know the stock detail using REST, then REST will return only data structure defined by XSD (Data Contract) but the SOAP will wrap the structure into SOAP envelope. The complexity of SOAP envelope is based on used message version and additional WS* protocols.

You can at least expect something like this from SOAP response:

  1. <s: Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">  
  2. <s: Header/>  
  3.    <S: Body>  
  4.       <result>  
  5.          <stock name="XYZ">  
  6.             <value>100</value>  
  7.             <exchange>ABC</exchange>  
  8.          </stock>  
  9.       </result>  
  10.    </s:Body>  
  11. </s:Envelope>