What is REST?

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>