Conversion Sample Policy

Overview

The Conversion sample policy takes a REST-style request and converts it into a SOAP call. This topic describes the REST to SOAP policy, and explains how to run this sample.

REST to SOAP Policy

The REST to SOAP policy is as follows:

Conversion policy

The REST to SOAP policy performs the following tasks:

  1. Extracts the information from the request (a message attribute is created for each query string and/or HTTP header).

  2. Creates a SOAP message using the Set Message filter.

  3. Sends the request to the StockQuote demo service.

  4. Extracts the value of the stock from the response using XPath.

  5. Creates a plain text response.

  6. Sets the HTTP status code to 200.

Running the Conversion Sample

You can call the sample service using the Send Request (sr) command or the API Gateway Explorer GUI:

SR Command

Enter the following command:

sr http://HOSTNAME:8081/rest2soap?symbol=ABC

For more details, see the topic on Stress Testing with Send Request (SR).

API Gateway Explorer

Perform the following steps:

  1. Specify the following URL in the Request Settings:

    http://HOSTNAME:8081/rest2soap?symbol=ABC

  2. Select GET as the verb.

  3. Click the Run button.

For more details, see the topic on Sending a Request with API Gateway Explorer.