Hi!
This matter is further complicated by the fact that JAX-WS has an asynchronous client model, which is what you described with your "imagination".
To enumerate the available options:
Synchronous invocation
The invocation do not return until the operation has finished processing.
Asynchronous one-way invocation
Also called "fire-and-forget". The request is sent to the web service but no response will be given. The client can continue to execute despite the request not having finished being processed, because the client does not need to wait for a result. When using a HTTP binding, there will be a confirmation that the request has reached the server, which the client must wait for.
Asynchronous client
The web service is still a regular, synchronous web service. The difference is on the client side, where a request is sent and and a special
thread is dispatched to await the result. The client can learn about the result either by a special object being called back when a result is available or by polling a response-object to examine if the operation has completed an a response is available.
In both cases, a timeout can be specified that limits the time the client waits for a result.
The client will never be called back, or need to poll, the web service - everything regarding the asynchronous invocation is taken care of on the client side.
Asynchronous web service.
The web service is asynchronous and supplies an operation with which clients can submit a task to the service.
There are two different ways by which clients can obtain the result of a task:
1. Polling.
The web service supplies another operation which the clients can invoke to check if a task has been processed, supplying a correlation identifier of some kind that tells the service which task the client wants to know about.
2. Callback.
The clients must provide a service which will be invoked by the web service to which the client submitted a task when the task has been processed.
A lot of text
, hope things are more clear!
Best wishes!