Hi Pooja,
I’am giving their difference in uses,please choose according to your requirements:
- REST:
REST is not a protocol, it is an architectural style
REST uses URL to expose the web service
REST allows different data formats: XML, JSON, plain text…
REST requires less bandwidth than SOAP
RESTful services inherits security measure from underlying transport layer
RESTful service can use SOAP web services as implementation
REST uses JSON. JSON is easier to parse than XML. Thus, REST uses less memory and CPU
REST is best for social media based Applications
2.SOAP:
SOAP is best for Enterprise web applications, banking transactions.
SOAP cannot use RESTful services because SOAP is a protocol.
SOAP uses only XML. XML is harder to parse. SOAP uses more memory and CPU
SOAP is more reliable in terms of security than REST.
SOAP uses its own security measures. SOAP is based on standardized Web service security. Thus, better secured compared to REST.
SOAP requires more bandwidth than REST.
SOAP Allows Only XML format.
SOAP uses WSDL class to expose the web service.
SOAP is a protocol.