File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Asynchronous web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Asynchronous web service" Watch "Asynchronous web service" New topic

Asynchronous web service

Pankaj Kumarkk
Ranch Hand

Joined: Apr 17, 2011
Posts: 110
JAX-WS 2.0 supports asynchronous web service using polling and callback mechanism.

Can somebody tell me if this is a feature specific to JEE or is it part of WS-I BP specification.
Thus can a C# client(ie a non java client) access a web service asynchronously.
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
You probably already knew the What as well the How. Is this the confirmation you're looking for?
Below is my understanding so far

In terms of What:

Provider WS { doSomething() }

Client invocation can;

Do a Blocking call:

1. WS.doSomething();

Do a Non Blocking call / Asynchronicity from the Client Side

1. WS.doSomething() by polling
2. WS.doSomething() by callback

In terms of How:

1. JAX-WS 2.x can do Blocking and non Blocking call from client side

2. C# can do Blocking call of course and Non Blocking call if feasible from C# (Check ASP.NET forum)

3. WS-I : neither J2EE nor .NET. They ensure the wsdl is inter-operable across platform. (Vague! check
Pankaj Kumarkk
Ranch Hand

Joined: Apr 17, 2011
Posts: 110
Thanks for the response. I still do not know if asynchronous web service is something driven from WS-I BP specification. Thus are all different WS-I BP compliant vendors supposed to provide asynchronous web services behavior.
I tried the WS-I web site but could not determine the answer.

H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
The way I understand:

Usually or most of the time, we have a synchronous web service. Synchronous = a Blocking call.

1. reponse =request.doIt();
2. this next statement (2) can not be executed until doIt() finished.

But some time, some web service take a long time to finish and we can not wait so we need a Non-Blocking call which is Asynchronous.

The question then how can we achieve "Asynchronicity" as a whole, 1 way is by JAX-WS 2.x on the client side. (My previous post.)

But there are many other ways as well without using JAX-WS 2.x.

Suppose for those who for technical reason can not use JAX-WS 2.x, then how do they achieve "Asynchronicity"?

Well, for example, Figure 10: Asynchronous services with JAX-RPC

Well, there are other ways as well...It's a matter of architecturing the web service flow as a whole to achieve Asynchronous aspect.

As for WS-I, they ensure the provider service is workable across all platforms. In the SOAP UI, you can validate the wsdl is WS-I complicant or not if you care about the Inter-operability of the service.

Remember, your best friend is GOOGLE
H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
Again, this is what I understand or at least try to understand.


WSDL is the key (Implicitly SOAP). Make sure it's WS-I/BP 1.x compliant. That's way all platforms understand it.
Implicitly vendors will make their web service engine/platform WS-I/BP compliant.


What WSDL should have and have not? GOOGLE.

Ensuring Interoperable Web Services
Part 5 - Integrating Java and Microsoft .NET

If you look for article from .NET side, you will have it.

Testing tools:

-Most IDE

This has nothing to do with the "Asynchronousity" side of a web service. Does it?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
There are two different kinds of asynchronous calls that can be made using a JAX-WS web service client.
1. An asynchronous call to an operation with the message exchange pattern request-response.
This will, to the client, look like an asynchronous operation but the asynchronicity is handled by the web service client code, who maintain an extra thread to receive answer(s).
Characteristic of this kind of operations is a Future<T> object being returned as a result of invoking the operation.

2. A call to an operation using the one-way message exchange pattern or an operation that immediately returns some kind of identifier token prior to the processing of the request having finished.
Such an operation will never return anything, but will rely on other mechanisms to convey the result of the operation to the client.
The client A invoke an operation in web service B that use the one-way message exchange pattern.
Client A enclose some additional data in the request (for instance in a SOAP header) that tells the web service where to send the result of the request.
Web service B processes the request and, when finished, use the information enclosed by the client to report the result to client A.
Results may be reported using, for instance, web services, message queues etc etc.

As you may realize, only imagination sets limits on how an asynchronous web service can report the result in the second case.
Thus, this is slightly out of scope for a web service stack, which probably will support asynchronous invocation of operations, but not directly support all the possible ways of reporting the result.
When using truly asynchronous web services, like in 2 above, you usually need more information than just a WSDL.
Best wishes!

My free books and tutorials:
I agree. Here's the link:
subject: Asynchronous web service
It's not a secret anymore!