Difference between REST and SOAP web services?

There is huge difference between REST and SOAP. Comparing SOAP and REST is not just right as they are different things.

Both approaches work, both have advantages and disadvantages to interfacing to web services, but it is up to the web developer to make the decision of which approach may be best for each particular case.

REST SOAP
REST has no WSDL interface definition SOAP has WSDL, which is an XML-based language for describing Web services and how to access them.
REST is over HTTP/HTTPS. SOAP can be over any transport protocols such HTTP, FTP, STMP, JMS etc.
REST permits many different data formats – XML, plain text, JSON, HTML etc where as SOAP only permits XML.
REST is much more lightweight and can be implemented using almost any tool, leading to lower bandwidth and shorter learning curve. Using SOAP is little bit complex, It takes more time to learn and develop.
REST is limited by HTTP itself which can’t provide two-phase commit across distributed transactional resources, But SOAP can.
REST services are easily cacheable. Caching situations: If the information needs to be cached.
REST is almost always going to be faster. SOAP Service is little bit slower.
No error handling Built-in error handling (faults)
No constraints on the payload Payload must comply with the SOAP schema
Gopal Das
Follow me

Gopal Das

Founder at GopalDas.Org
He is a technology evangelist, Salesforce trainer, blogger, and working as a Salesforce Technical Lead. After working in Java based project implementation, he jumped to the Salesforce system on a whim and never looked back. He fell in love with Salesforce’s flexibility, scalability, and power. He expanded his knowledge of the platform and became a Certified App Builder, Administrator, Platform Developer I, SalesCloud Consultant while leading the Salesforce implementation and technology needs. He has worked in a wide variety of applications/services like desktop, web and mobile applications.
Gopal Das
Follow me

Leave a Reply

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