Creating an API for a SOAP Service

Quickstart tutorial to expose a SOAP service via a REST API.

Introduction

This tutorials shows how to use a SOAP service that takes one input parameter. This service converts temperature from Fahrenheit to Celsius and Celsius to Fahrenheit.

Creating an API Express Project

To start you are going to create an API Express project.

  1. Go API Express tab.
  2. Click Create new project button.
  3. For name enter: temperatureAPI. Optionally enter the API description.
  4. From the main API page click new service link.
  5. For Service group name enter: temperature.
  6. Select Custom REST API option and click the Create button.

The visual service editor will load where you will use the SOAP component.

Using the SOAP component

  1. Drag and drop the SOAP component into the flow. The flow should consist of Start, SOAP and End components.
  2. Select the SOAP component and enter this URL http://www.w3schools.com/xml/tempconvert.asmx?WSDL for WSDL URL in Properties.
  3. Click Retrieve to configure this service.
  4. After a few seconds, open the Service list and select TempConvert.
  5. For Port select TempConvertSoap12 option.
  6. For Operation select FahrenheitToCelsius. Once you make this selection the request will be automatically populated.
  7. In the Request Body, find the following line of code: <ns:Fahrenheit>?</ns:Fahrenheit> and replace the ? with ' + PARAMS.QUERY.temperature + '. It should look like this:
<ns:Fahrenheit>' + PARAMS.QUERY.temperature + '</ns:Fahrenheit>
  1. Select the Start component (top circle).
  2. For URI template enter tempconvert.
  3. With the Start component still selected, under the Query Parameters section, add a temperature parameter of the String type.
  4. Click Save. You are now ready to test the service. Click Test to test the service.