HelloWorldAsync.jws Sample

A simple asynchronous web service that illustrates the use of a callback. Uses a Timer control to provide a delay that simulates waiting for a slow back-end service to do some work, then notifies the client of the result via a callback. HelloWorldAsync.jws is used by the Conversation.jws sample, but is also a standalone web service.

Concepts Demonstrated by this Sample

Location of Sample Files

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

BEA_HOME\weblogic81\samples\workshop\SamplesApp\WebServices\async\HelloWorldAsync.jws

To Run the Sample

  1. Start WebLogic Server in the appropriate domain.
  2. Launch the service either by opening it in WebLogic Workshop and selecting the Start operation or by entering http://localhost:7001/WebServices/async/HelloWorldAsync.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.
  3. Navigate to the Test Form tab of Test View, if necessary.
  4. Invoke the HelloAsync method to create a new conversational instance and invoke the simulated legacy system operation.
  5. After 5 seconds, HelloWorldAsync invokes the onHelloResult callback on the client.
  6. Refresh the browser periodically until the callback.onHelloResult callback entry appears in the Message Log.
  7. 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

Designing Conversational Web Services

Test View