SimpleJMS.jws Sample

A web service that demonstrates use of a JMS control that sends to and receives from a queue.

# Concepts Demonstrated by this Sample

- Use of a JMS control with a queue

- Declaration and use of a client callback

- Use of Conversations

# Location of Sample Files

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

BEA_HOME\weblogic700\samples\workshop\applications\samples\jms\SimpleJMS.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/jms/SimpleJMS.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. Enter a value for name and invoke the start method to start a conversation.

5. Navigate to the continue and finish methods for the conversation by clicking on the conversation ID (the large number) at the top of the section in the Message Log.

6. Enter values for msg and invoke the sendString method. The values are packaged in a message and sent to a JMS queue via the JMS control myCustomQ, which is an instance of CustomJMSControl.

7. Since the JMS control in this simple example is configured to listen to the same queue it sends to, the message immediately arrives and is forwarded to the web service via the onMessageReceived callback. Refresh the browser to see the callback entry appear in the Message Log.

8. Select log entries in the Message Log to see the message traffic involved in each interaction.

Related Topics

CustomJMSClient.jws Sample

Controls: Using Resources from a Web Service

JMS Control: Using Java Message Service Queues and Topics from Your Web Service

Maintaining State with Conversations

Test View