Tutorial: Creating a SOAP API

This tutorial shows you how to create an API definition by using a SOAP service Web Service Definition Language (WSDL). This API definition simplifies creating and managing access to the SOAP service.

About this tutorial

In API Manager, you create an API by importing the WSDL for an existing SOAP service. Both SOAP 1.1 and SOAP 1.2 standards are supported by API Connect. When called, the API takes a SOAP request from the API caller and uses it to make its own request to the SOAP service. The API then returns the response of the SOAP service. In this tutorial, the SOAP service returns the balance of an account corresponding to a user identifier.
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.

Creating a SOAP API

To create an API for an existing SOAP service, complete the following steps:

  1. Download the SOAP WSDL file AccountService.txt. Rename this file AccountService.wsdl.
  2. Log into the 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 (SOAP proxy). Click Next.

    WSDL confirmation screen

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

    WSDL confirmation screen

  7. Select AccountService. 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.

    Summary of results (top)

  11. Click Edit API.

You have created a SOAP API and included it in a Product. The WSDL file has provided the information needed to configure the API's inputs and response.

Testing your SOAP API

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 add your SOAP API to a Product and Plan, and then test it, complete the following steps:

  1. Click Assemble.

    Assemble page

  2. On the Assemble page, click the Test icon. The Test icon. The test tool opens.

    Assemble page

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

    Select operation

  4. In the Body field, of the Parameters section, enter the following request body:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><ban:getBalance xmlns:ban="http://bankA.sample.ibm.com/">
      <arg0>3</arg0>
    </ban:getBalance></SOAP-ENV:Body></SOAP-ENV:Envelope>
    This request body is the same as would ordinarily be passed to the SOAP endpoint, and requests the balance of the account identified by the arg0 node. However, unlike the SOAP service, the API requires identification using a Client ID, which is enforced by the gateway server.
  5. Click Invoke.

    Invoke test

    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.

    Invoke test

What you did in this tutorial

In this tutorial, you completed the following activities:

  • Created a SOAP API
  • Tested your SOAP API