AdvancedTimer.jws Sample
A web service that demonstrates an asynchronous interface to a simulated legacy system (LegacySystem.jws) that does not support asynchrony. It does so by "polling" the legacy system: calling it at intervals to see if it is finished. AdvancedTimer does the polling for the client, invoking a client callback if and when the legacy system responds.
Use of a Timer control
Use of a Service control
Declaration and use of a client callback
Use of the JwsContext interface
Use of Conversations
Polling
This sample is located in the timer folder of the samples WebLogic Workshop project. In the file system the location is:
BEA_HOME\weblogic700\samples\workshop\applications\samples\timer\AdvancedTimer.jws
To run this web service:
Start WebLogic Server in the appropriate domain.
On Microsoft Windows systems, from the Start menu navigate to:
BEA WebLogic Platform 7.0->WebLogic Workshop->WebLogic Workshop Examples->Start Examples Server.
On Linux or Solaris systems, run:
BEA_HOME/weblogic700/samples/workshop/startWebLogic.sh
Launch the service either by opening it in WebLogic Workshop and selecting the Start operation or by entering http://localhost:7001/samples/timer/AdvancedTimer.jws in the address bar of your browser. If WebLogic Server is running in the appropriate domain on this machine, you may click here to run the sample.
Navigate to the Test Form tab of Test View, if necessary.
Invoke the start method to create a new conversational instance and invoke the operation on the simulated legacy system.
After the legacy system completes it's operation, AdvancedTimer will invoke the onDone callback on the client. If the legacy system does not complete in 15 seconds, AdvancedTimer will invoke the onDone callback anyway, but with a failure indication.
Refresh the browser periodically until the callback.onDone callback entry appears in the Message Log.
Select log entries in the Message Log to see the message traffic involved in each interaction.
Controls: Using Resources from a Web Service
Timer Control: Using Timers in Your Web Service
Service Control: Using Another Web Service
Maintaining State with Conversations
Using Callbacks to Notify Clients of Events