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, which means that the web service calls the legacy system 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.

Concepts Demonstrated by this Sample

Location of Sample Files

This sample is located in the timer folder of the WebServices project in the SamplesApp sample application. In the file system the location is:

BEA_HOME\weblogic81\samples\workshop\SamplesApp\WebServices\timer\AdvancedTimer.jws

To Run the Sample

  1. Start WebLogic Server in the appropriate domain.
  1. Launch the service either by opening it in WebLogic Workshop and selecting the Start operation or by entering http://localhost:7001/WebServices/timer/AdvancedTimer.jws in the address bar of your browser. If WebLogic Server is running in the appropriate domain on this machine and you have deployed the SamplesApp sample application, you may click here to run the sample.
  2. Navigate to the Test Form tab of Test View, if necessary.
  3. Invoke the start method to create a new conversational instance and invoke the operation on the simulated legacy system.
  4. After the legacy system completes its operation, AdvancedTimer invokes the onDone callback on the client. If the legacy system does not complete in 15 seconds, AdvancedTimer invokes the onDone callback anyway, but with a failure indication.
  5. Refresh the browser periodically until the callback.onDone callback entry appears in the Message Log.
  6. Select log entries in the Message Log to see the message traffic involved in each interaction.

Related Topics

Using WebLogic Built-In Controls

Timer Control

Web Service Control

Designing Conversational Web Services

Using Callbacks to Notify Clients of Events

Using Polling as an Alternative to Callbacks

JwsContext Interface

SimpleTimer.jws Sample

Test View