Running the RESTful Web Service Using JSON sample

You can run this sample to complete the following tasks:

  1. Retrieve a list of all data about all the CDs, or a selection of CD data, based on your search string by using the WebSphere MQ JSON consumer message flow or the JSONP web page.
  2. Insert the data for one or many new CDs.
  3. Update the data for an existing CD.
  4. Delete the data for a CD.

If you encounter any problems when you run the sample, see Resolving problems when running samples in the WebSphere Message Broker documentation.

To run the sample:

  1. Ensure that the sample message flows have been deployed.
  2. In the Broker Development view, expand the JSON REST Sample Message Broker project, JSONRESTSampleFlowProject. Under Flow Tests, double-click MqJsonClientConsumer.mbtest to open it in the Test Client.
  3. In the Test Client, notice that there are several Message Flow Test Events. Click the first Message Flow Test Event. Note that the MQInput node is set to RETRIEVE_IN1.
  4. Click Send Message.
  5. The Select Deployment Location window opens. Click Finish.
  6. When the test is complete, the CD data is displayed in the message data portion of the screen.
  7. Repeat steps 3 to 5 for each of the Message Flow Test Events, taking note of which MQInput node is being used. The following tasks are completed, listed in order of Message Flow Test Events:
    1. Returns records with the title "Friars Ball".
    2. Updates records with the title "Friars Ball". The artist is changed from "Deep Blue" to "Deep Orange".
    3. Returns records with the title "Friars Ball". All the changes that have occurred are displayed.
    4. Returns data for all CDs. You can also view JSONPConsumer.html.
    5. Deletes records with the title "Friars Ball". Returns with a success or failure message.
    6. Creates a new entry, and returns data for all CDs.
    7. Returns data for all CDs. You can also view JSONPConsumer.html.
    For more information about what each queue does, see About the RESTful Web Service Using JSON sample.

To run the WebSphere MQ XML consumer message flow, open the MqXmlClientConsumer.mbtest flow test and repeat the previous steps.

You can also access the web service directly, by using the HttpJsonRestProvider.mbtest flow test.

Back to sample home