Service for Asynchronous Client calls (polling, callback)
Joined: Oct 11, 2011
I am a WebService learner and digging through all this stuff isn't easy with all that maybe-outdated-but-still-usable technology floating around. Here's my thing.
My goal is to create a WebService that can be called to perform a time-consuming task. This should be done asynchronously since the client is required to continue working. On my way to achieve this I have stumbled upon JAX-WS 2.0 and it's possibility to create web services via annotation. It also allows asynchronous calls with the @oneway annotation.
Now, I to my understanding (and from several different sources on the web) it seems like I need a server working synchronously which returns a Response<?> (for a polling approach). For a callback approach it seem to be needing an AsyncHandler and sometimes a Future<?>.
Here's how that is supposed to look:
Here's the endpoint code:
I am using Java 1.6.0_26 and Eclipse Indigo with WTP. I have not actively deployed this code to any server, I am just running this Publisher class above. Everything was working fine until either Response, Future or AsyncHandler are added to the code.