Tutorial: Creating a REST API definition that invokes an existing SOAP service

This tutorial shows you how to expose an existing SOAP service and transform the XML data that is returned by it into specified JSON data.

About this tutorial

In API Manager, you will create a REST API that accesses a SOAP service.
Note: The Sandbox catalog must be configured to use either a DataPower® Gateway (v5 compatible) or a DataPower API Gateway or both. See Creating and configuring Catalogs.

Setting up a REST API definition

To set up a REST API, complete the following steps:

  1. Download the SOAP WSDL file AccountServicing.txt. Rename this file AccountServicing.wsdl.
  2. Log in to API Manager.
  3. Click the Develop APIs and Products tile.

    API Manager screen

  4. Click Add > API.

    API add menu

  5. Select From existing WSDL service (REST proxy). Click Next.

    Create REST proxy

  6. Click Browse. Select the AccountServicing.wsdl file from your filesystem. The file uploads and is parsed by API Connect. You see a confirmation. Click Next.

    WSDL confirmation screen

  7. On the Select Service screen, click Next.

    WSDL Service screen

  8. On the Info screen, leave the inputs unchanged. Click Next.

    API info

  9. On the Secure screen, check Limit API calls on a per key basis. In the Activate API section, check Activate API. Click Next.

    API Security and Publishing

  10. The screen now displays progress through the steps to create and publish the new API. When this process completes, you see a summary of results, including the API Endpoint URl of the new API and the credentials of the Application automatically subscribed to the new API. Click Edit API.

    Summary of results (top)

  11. The Design tab for the draft of your API definition opens. Click Assemble.

    Design page (top)

Test your API definition

Note: Due to Cross-Origin Resource Sharing (CORS) restrictions, the assembly test tool cannot be used with the Chrome or Safari browsers on the macOS Catalina platform.

To test your API definition by using the API Manager test tool, complete the following steps:

  1. Click the Test icon The Test icon. The test tool opens.

    API Security and Publishing

  2. In the Operation field, select post /getBalance.

    Select operation

  3. In the request field, click Generate. A sample request fills the field.

    Generate request

  4. Click Invoke. The response is displayed.
    Note: If you are using a self-signed certificate, you might be prompted to visit a provided URL. Click the link and then accept the certificate before returning to API Manager and clicking Invoke again.

    Test setup

What you did in this tutorial

In this tutorial, you completed the following activities:

  • Set up a REST API definition
  • Configured an API to invoke an existing web service and return its output
  • Tested your API definition