1.

What is REST and SOAP? What is different between them?

Answer»

REST (Representational State Transfer):  It is a NEW and improved form of web service. It describes the architectural style of networked systems. It does not require greater bandwidth when requests are sent to the SERVER. It just includes JSON message. For example:

{"city":"Mumbai","state":"Maharashtra"}

SOAP (Simple Object Access Protocol): It is a simple and lightweight protocol that is generally used for exchanging structured and typed information on the Web. It works mostly with HTTP and RPC (Remote Procedure Call). This protocol is mainly used for B2B applications one can define a data contract with it. SOAP messages are heavier in content and THEREFORE use greater bandwidth.

For example:

<?xml version="1.0"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope" SOAP-ENV:encodingStyle=" http://www.w3.org/2001/12/soap-encoding"><soap:Body><Demo.guru99WebService xmlns="http://tempuri.org/"> <EmployeeID>int</EmployeeID> </Demo.guru99WebService> </soap:Body></SOAP-ENV:Envelope>
RESTSOAP
It is basically an architectural pattern.It is basically a messaging protocol.
It usually works with various text formats such as PLAIN text, HTML, JSON, XML, etc.It only works with XML formats.
It is totally stateless.It has some specifications for both stateless and stateful implementation.
Its performance is faster as compared to SOAP.Its performance is slower as compared to REST.
It uses XML and JSON to send and receive data.It uses WSDL (Web Service Description Language) for communication among consumers or users and providers.
REST has to resend transfer whenever it determines any errors.SOAP includes built-in error handling for communications errors using WS-ReliableMessaging specification.
It CALLS services using the URL path.It calls services by calling RPC (Remote Procedure Call) method.


Discussion

No Comment Found