When to use SOAP & When to use REST ?

Before starting with When? for using SOAP and REST. Let’s just go through basic definition of each.

SOAP:

Simple Object Access Protocol is messaging protocol specification for exchanging structure information between two application.

REST:

REpresentational State Transfer is an architectural style for providing standards between computer applications.

SOAP Services can be used in below scenarios:

  1. Stateful Operations are required. (eg. E-commerce website which has Shopping cart which has to maintain state across the User session and afterwards as per the need)
  2. Asynchronous processing and subsequent invocations.
  3. A formal means of communications.

REST Services can be used when Business has priorities as below:

  1. Limited resources
  2. Statelessness
  3. Caching
  4. Ease of coding

Join Discussion

This site uses Akismet to reduce spam. Learn how your comment data is processed.