After long years of developement of SOAP and REST web services thought of recollect what is the difference between SOAP and REST and these came in my mind.......
SOAP - Simple Object Access Protocol
SOAP web services are schema(WSDL, XSD) based web services. Both the requests and responses are in XML format. For enterprise level or distributed applications we can use SOAP web services and its easy to communicate with different end points. Built in error handling techniques and retry logic but SOAP data reads cannot be cached. It support SSL security.
REST - Representational State Transfer
REST web services are not a schema based web services. We can control the request and response format based on the requirement. The most commonly used is JSON format. we can easily send the response as in XML, HTML etc. formats as we required. REST Web services are useful for public exposed web services. The REST reads are cashed. Comparatively faster than SOAP. Support both WS- Security and SSL. And it is easy to write clients and APIs with REST.
Good one, Legin. Keep it up..
ReplyDeleteSOAP supports WS-Security too.. In fact SOAP is more secure. It supports multiple WSS specs like SAML, X509, Kerboros, Simple UserId/Password, and even custom defined tokens. SOAP is a protocol only and error handling techniques have to be developed in the implementations. However, it has predefined the error handling specifications, whereas REST does not specify those. There are ways to disable REST caching too . Appending a timestamp is one way to do it. Setting response headers like pragma and expires also disables it but is not recommended from a best practices point of view.