Differences between SOAP & REST Web Services

Profile picture for user devraj

Below are the difference between SOAP and REST

Point of DistinctionSOAPREST
Stands forSimple Object Access ProtocolREpresentational State Transfer
Type, Design and ImplementationSOAP is a protocol. Standardized protocol with pre-defined rules to follow. It has official Standard.   Rest is an Architectural Style with loose guidelines and recommendations. No official Standard at all.
Can use each otherSOAP can't use REST because it is a protocol and REST is an architectural pattern.REST can use SOAP web services because its concept can use any protocol like HTTP, SOAP etc.
ApproachFunction-driven (data available as services, e.g: "getUser")Data-driven (data available as resources, e.g. “user”).
StatefulnessStateless by default, but it's possible to make a SOAP API stateful.Stateless (no server-side sessions). You can not make it stateful.
How business logic exposedSOAP uses services interfaces to expose business logic.REST uses URI to expose business logic.
Java APIJAX-WS - Java API for XML Web ServicesJAX-RS. Java API for RESTful Web Services
Transfer ProtocolLargely based on XML and HTTP. Defines standards to be strictly followed.Uses multiple standards like HTTP, JSON, URL and XML.
Description LanguageWSDL - Web Services Description languageWADL - Web Application Description Language
Bandwidth and resource requirementSOAP is difficult to implement and it requires more bandwidth as it needs to convert the data in XML which increases its payload and results in the large sized file.As REST API deploys multiple standards, so it takes fewer resources and bandwidth as compared to SOAP that uses XML for the creation of Payload and results in the large sized file.
Service InterfacesOn behalf of services interfaces to business logic, SOAP uses @WebServicewhereas REST instead of using interfaces uses URI like @Path.
SecuritySOAP defines its own security. SOAP has SSL( Secure Socket Layer) and WS-security. In the case of Bank Account Password, Card Number, etc. SOAP is preferred over REST.RESTFul web services inherits security measures from the underlying transport. REST has SSL and HTTPS. 
CachingAPI calls cannot be cached.API calls can be cached.
Message FormatSOAP uses only XML for exchanging information in its message format.REST is not restricted to XML and its the choice of implementer which Media-Type to use like XML, JSON, Plain-text. Moreover, REST can use SOAP protocol but SOAP cannot use REST.
Preferred by companiesLessMore compare to SOAP
Recommended ForEnterprise apps, high-security apps, distributed environment, financial services, payment gateways, telecommunication services.Public APIs for web services, mobile services, social networks.
ACID Transaction PropertySupportedSome of the applications require transaction ability which is accepted by SOAP whereas REST lacks in it.
FasterFastFaster than SOAP
Convenient with JavaScriptSOAP APIs are also convenient with JavaScript but don't support for greater implementation.REST APIs are more convenient with JavaScript and can be implemented easily as well. 
Application SupportWeb OnlyWeb, Mobile, Desktop etc.