Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean when a web service is asynchronous?

What does it mean when a web service is asynchronous? Is this only used when you call it with Ajax and you have a part on your page that refreshes when the web service is done? Thank you.

like image 234
johnny Avatar asked Nov 19 '10 18:11

johnny


People also ask

What is asynchronous Web services?

The asynchronous web services receives the request, sends a confirmation message to the initiating client, and starts process the request. Once processing of the request is complete, the asynchronous web service acts as a client to send the response back to the callback service.

Whats the difference between synchronous and asynchronous?

The key difference between synchronous and asynchronous communication is synchronous communications are scheduled, real-time interactions by phone, video, or in-person. Asynchronous communication happens on your own time and doesn't need scheduling.

What is synchronous and asynchronous in REST API?

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. In this case, the client is notified when the response arrives.

Is SOAP web service synchronous or asynchronous?

Asynchronous Web Services (SOAP Web Services Only) Asynchronous operation is extremely useful for environments in which a service, such as a loan processor, can take a long time to process a client request.


2 Answers

I know this is an old topic, but whether a web service is synchronous or asynchronous depends on the design of the web service and has nothing to do with Ajax. An asynchronous web service transaction proceeds like this:

  1. The client calls the web service. In the call the client sends a callback end point implemented as a service by the client.
  2. The web service returns a "message received" reply. ... (Some other processing occurs) ...
  3. The web service completes its task, then calls the callback endpoint provided by the client.
  4. The client callback replies with message received.

See Developing Asynchronous Web Services or How to: Create Asynchronous Web Service Methods

like image 137
Donald Avatar answered Sep 21 '22 13:09

Donald


The question is whether it's the web service that's asynchronous, or your access to it. In the context of a web page, it's more likely that the service is synchronous, but that it is being accessed asynchronously.

Most likely, the service is being called via AJAX. The call is made to the service, and the page then continues. When the response comes in, either the success or the failure functions are executed, asynchronously.

like image 41
John Saunders Avatar answered Sep 18 '22 13:09

John Saunders