Get your CodeRanch badge!*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes How does client poll the interaction layer to get the result of WS invocation? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "How does client poll the interaction layer to get the result of WS invocation?" Watch "How does client poll the interaction layer to get the result of WS invocation?" New topic
Author

How does client poll the interaction layer to get the result of WS invocation?

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Hello All,

In the Endpoint Design and Architecture objective of the certification, I was going through some time sequence diagrams on how service handles the request Asynchronously using some sort of queuing. Whether the Service is handling the request synchronously or asynchronously, we know that client has an opportunity to poll for the result based on the response (some kind of token) returned by the service for later lookup.

Now assume that there are two clients clientA and clientB sending the request to interaction layer asynchronously and the interaction layer returns each of them with a unique token for them to poll later and things move on. Later when each of the client tries to poll the service, how would service know which response corresponds to which client. Does the service maintain any client specific information? I believe, it should be stateless. Then how does it achieve this.


In the event of client making Asynchronous call and service handling the request Synchronously, client will have the response immediately, but has an opportunity to look for the response at a later time without blocking, by checking isDone() method of Future interface. This is possible, because the response is actually available.


But In the event of client making Asynchronous call and service handling the request Asynchronously, response is not available right away and service can generate the response at a later point. What would happen under the hood, when the polling is done by client? Would there be another call the WS?


Regards
KumarRaja

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 516
    
    2

Any thoughts on my question.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
The service that is polled for a result some time after the original request has been made may store the result in a database or a hashmap, using the unique client id as key.
There would be a special operation in the service to do this. The information in the database or hashmap is, of course, client-specific.
I guess that, in a sense, this could be considered as client state and it may have a negative impact on the scalability of the service.
Hope this answers your question.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How does client poll the interaction layer to get the result of WS invocation?
 
Similar Threads
Question about Invoking a Web Service Asynchronously
Question on Asynchronous web service call using document style.
Asynchronous web service
Asynchronous call in the Server side?.,
Asynchronous web service