What is the difference between a REST web service and a SOAP web service?
Below are the main differences between REST and SOAP web service
- REST supports different formats like text, JSON and XML; SOAP only supports XML.
- REST works only over HTTP(S) on a transport layer; SOAP can be used different protocols on a transport layer.
- REST works with resources, each unique URL is some representation of a resource; SOAP works with operations, which implements some business logic through different interfaces.
- SOAP based reads can’t be cached, for SOAP we need to provide caching; REST based reads can be cached.
- SOAP supports SSL security and WS-security(Web Service-security); REST only supports SSL security.
- SOAP supports ACID (Atomicity, Consistency, Isolation, Durability); REST supports transactions, but it is neither ACID compliant nor can provide two phase commit.