Buffer.jws Sample

A web service that demonstrates the @jws:message-buffer tag to queue high-traffic requests. Uses a Timer control to delay sending a response back to the client, simulating waiting for a slow back-end service to respond to requests from this web service. The start method is buffered, allowing clients to continue processing immediately after submitting a request.

Concepts Demonstrated by this Sample

Location of Sample Files

This sample is located in the async folder of the samples WebLogic Workshop project. In the file system the location is:

BEA_HOME\weblogic700\samples\workshop\applications\samples\async\Buffer.jws

How to Run the Sample

To run this web service:

  1. 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

  2. Launch the service either by opening it in WebLogic Workshop and selecting the Start operation or by entering http://localhost:7001/samples/async/Buffer.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.

  3. Navigate to the Test Form tab of Test View, if necessary.

  4. Invoke the startBufferAsync method to create a new conversational instance and invoke the operation on the simulated legacy system.

  5. After the artificial delay, Buffer will invoke the BufferResult callback.

  6. Refresh the browser periodically until the callback.BufferResult 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

Controls: Using Resources from a Web Service

Timer Control: Using Timers in Your Web Service

Maintaining State with Conversations

JwsContext Interface

Conversation.jws Sample

Test View