Monday, July 1, 2019

API Testing 03: SOAP vs REST web services

To happen any communication or data exchange between any two devices or applications over World Wide Web, we have two types web services, Simple Object Access protocol (SOAP) and Representational State Transfer (REST) web services.

Both SOAP and REST are meant for the same purpose, but how they work and what they use for communication to happen differentiates them. Lets understand them in detailed.



Simple Object Access Protocol (SOAP): is a protocol it works  is originally developed by Microsoft to access the web services. SOAP uses XML messaging over HTTP with some specification which could be understood across all applications.

The web services developed using SOAP protocol are called SOAP web services. SOAP only works with XML format messaging.

SOAP service includes WSDL file, which provides the information about what the web service does and location of the web service. Thus SOAP requires more  bandwidth for message transfer as it includes lot of information.

Representational State transfer Protocol (REST): is a architecture style, and it uses HTTP protocol for web services. REST supports different data formats JSON, HTML, XML, Text and etc. as messaging system, but JSON is the most preferred format.

The web services designed using REST architecture style are called RESTful web services. REST architecture style is used for building the web services that are lightweight, maintainable and salable in nature.

And a RESTful service uses HTTP methods GET, POST, PUT and DELETE for working with required components.

REST doesn't require much bandwidth when request sent to server. REST messages mostly consists of JSON format, the message size smaller compared to SOAP messages size.

No comments:

Post a Comment

Java Program 6: How to reverse a String in Java?

In this post we will discuss different methods to reverse a String in java programming. Method 1: Step 1: Read the input string using ...