Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Soap supports asynchronous call while Rest does not?

I was going thru Soap vs Rest on net and found most of them says Soap supports asynchronous call while Rest does not but did not get any concrete example of that. Can anybody help me here?

Here is one of the resources i was referring to

http://web.archive.org/web/20120421084456/http://www.prescod.net/rest/rest_vs_soap_overview/ http://searchsoa.techtarget.com/tip/REST-vs-SOAP-How-to-choose-the-best-Web-service http://seanmehan.globat.com/blog/2011/06/17/soap-vs-rest/

As per my understanding both should be synchronous. In both cases client makes a call to web service either thru soap or rest, client waits till response comes back from service. So how come soap supports asynchronous behaviour while rest does not?

like image 413
M Sach Avatar asked May 25 '14 16:05

M Sach


People also ask

Does REST support asynchronous?

Both MicroProfile Rest Client and JAX-RS can enable asynchronous clients. A synchronous client constructs an HTTP structure, sends a request, and waits for a response. An asynchronous client constructs an HTTP structure, sends a request, and moves on.

Are SOAP calls synchronous?

SOAP services, depending on specified interaction patterns, can be generated synchronously, asynchronously, or both synchronously and asynchronously to meet your business needs. REST services can be generated with synchronous operation only.

What is the main difference between SOAP and REST web services?

REST is a set of guidelines that offers flexible implementation, whereas SOAP is a protocol with specific requirements like XML messaging. REST APIs are lightweight, making them ideal for newer contexts like the Internet of Things (IoT), mobile application development, and serverless computing.


1 Answers

REST is purely an HTTP transport based call and you will receive a response say 200 OK on the other side,

SOAP uses two varieties,

  • Synchronous Messaging over HTTP
  • Asynchronous Messaging over HTTP

With synchronous messaging, the Requestor makes a request and the transport layer code blocks waiting for a response from the Provider. The Requestor receives the response on the same HTTP connection that the Requestor initially established to send the request. Synchronous exchange is usually easier to implement and requires that the Provider be able to generate a response in a short time, specifically in a time less than the HTTP timeout value(generally 120sec). [A single HTTP Connection is used that itself behaves Synchronously]

With asynchronous messaging, the Requestor is able to release transport specific resources once the request is acknowledged by the responder, knowing that a response will eventually be received. When the Provider completes the processing of the message it sends a response back to the Requestor over a new HTTP connection. [Here we utilize two HTTP Connections to implement an asynchronous messaging

  • first HTTP Connection is used that for sending the Request and receiving an acknowledgement HTTP Response 200/OK
  • second HTTP Connection is used for receiving the callback and responding HTTP Response 200/OK]

Rijoy https://soascribbles.wordpress.com/

like image 77
user3958474 Avatar answered Sep 27 '22 20:09

user3958474