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.
- Go API Express tab.
- Click Create new project button.
- For name enter: temperatureAPI. Optionally enter the API description.
- From the main API page click new service link.
- For Service group name enter: temperature.
- 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
- Drag and drop the SOAP component into the flow. The flow should consist of Start, SOAP and End components.
- Select the SOAP component and enter this URL http://www.w3schools.com/xml/tempconvert.asmx?WSDL for WSDL URL in Properties.
- Click Retrieve to configure this service.
- After a few seconds, open the Service list and select TempConvert.
- For Port select TempConvertSoap12 option.
- For Operation select FahrenheitToCelsius. Once you make this selection the request will be automatically populated.
- 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>
- Select the Start component (top circle).
- For URI template enter tempconvert.
- With the Start component still selected, under the Query Parameters section, add a temperature parameter of the String type.
- Click Save. You are now ready to test the service. Click Test to test the service.
Updated about 5 years ago