SOAP vs REST

By | January 25, 2018

 

What is SOAP(Simple Object Access Protocol)

-Is an xml based messaging protocol using by web services
-Is a format for sending and receiving messages
-Is platform independent
-Is based on XML
-Is a W3C recommendation
-Language,Platform & Transport Independent,Distributed Enterprise
-Environments,Standardized,Pre-build extensibility
-Built in error handling
-Automation
-Soap overhead,schema confirmation(xsd,wsdl),ws standards,xml
-Main advantage of soap is that it provides a mechanism for services to describe themselves
-To clients and to advertise their existence
-Will run on smtp,http,ftp return xml for all messages

REST(Representative State Transfer)

​-It seeks to fix the problems with soap and provide a truly simple method of accessing web services
-%70 of all apis are REST API s
-No expensive tools required to interact with the web services
-Smaller learning curve
-Fast,no expensive processing required
-Efficient
-Rest can use smaller message formats
-Closer to other web technologies in design philosophy
-wsdl 2.0
-Xml,json,plain text, html


When SOAP or REST?
The clients have to know what to send and what to expect in general when
You are publishing an api to the outside world that is either complex or likely to
change soap will be more useful, on the other hand Rest is usually the better option
if your application is guaranteed level of reliability and security
Then soap offers additional standards to ensure this type of operation ,on the other hand rest
is totally stateless and best for stateless crud operations

SOAP REST
A XML Based Protocol An Architectural Style Protocol
​Uses WSDL for communication between Uses XML ​or JSON to send and receive data
​Consumer and provider i​nvokes services by calling RPC method ​Simply call ​services via URL path
​Does not return human readable result ​Result is readable which is just ​plain XML or JSON
​Transfer is over HTTP,also uses other p​rotocols such as SMTP,FTP,etc. ​Transfer is over HTTP only
​Javascript can call SOAP,but it is difficult to implement ​Easy to call from javascript​
​Performance is not great compared to REST ​Performance is much better compared to SOAP,less CPU intensive

One thought on “SOAP vs REST

Leave a Reply

Your email address will not be published. Required fields are marked *