This demo shows the use of WS-ReliableMessaging for asynchronous reliable request/response communication.
See overview at one-way demo.
The service shows how to correlate a request sequence to the response one. The correlation means that request and response sequences will have the same length. It is also possible to send reliable responses using one-length sequences (see a comment in the service class).
![]() | Note |
---|---|
In the current version of SESJ it is not possible to create a persistent "AsynchronousConversation" when using asynchronous invocation. It is not possible to retrieve undelivered responses after SESJ restart. You can use synchronous (blocking) or two one-way invocations for now. |
In addition to the files described in Files and Directories, this demo contains:
File or directory | Description |
---|---|
src/demo/reliability/reqresp/client/ | Client source code |
src/demo/reliability/reqresp/server/ | Server source code |
wsdl/ReqRespService.wsdl | Service WSDL file |
You can run the demo using "run.sh" or "run.bat" scripts. The script on invocation without arguments prints out a help message.
Compile and publish request/response service (located in src/demo/reliability/reqresp/server). Runtime publication of a reliability-aware service is demonstrated there.
Windows: run.bat make_server run.bat run_server Linux: ./run.sh make_server ./run.sh run_server (use a new terminal)
Make client classes ...
Windows: run.bat make_client Linux: ./run.sh make_client
Run the ReqRespClient (it calls ReqRespService). You can try to run the client while the server is offline, then start the server and try to run the client again. Now, messages scheduled for delivery when the server was offline will be sent to the server. You can also interrupt (shutdown) the client or the server during an invocation. You can see that they will continue with incomplete sequences after restart.
![]() | Warning |
---|---|
SESJ currently does not support persistent response receipts, therefore the client will not be able to retrieve responses to messages sent before the client restart. |
Windows: run.bat run_client [anonymous] Linux: ./run.sh run_client [anonymous]
You can also run an anonymous client by using "run_client anonymous" instead of "run_client" as the target.
If you wish to follow the progress of the invocation with SoapSpy, perform the following:
Run server_java60/bin/soapspy.bat or soapspy.sh. This will bring up the SoapSpy GUI.
Start spying by selecting Start Spying from the Spy menu or by clicking the spy icon in the main pane.
Run the client using the run spy_client command instead of run_client.