[V5.0.7 or later]

Tutorial for creating a SOAP API

This tutorial shows you how to create an API definition by using a SOAP service's Web Service Definition Language (WSDL) in IBM® API Connect Version 5.0.7 and later. This API definition allows simplified access to, and management of, access for the SOAP service.

About this tutorial

Note: For tutorials about working with the API Manager in IBM API Connect Version 5.0.6 and earlier, see API Manager tutorials for V5.0.6 and earlier.

In API Manager, you create an API by importing the WSDL for an existing SOAP service. 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.

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. In API Manager, if you have not previously pinned the UI navigation pane then click the Navigate to icon The Navigate to icon. The API Manager UI navigation pane opens. To pin the UI Navigation pane, click the Pin menu icon The Pin menu icon..
  3. Click Drafts in the UI navigation pane and then click the APIs tab. The APIs tab opens.
  4. Click Add > New OpenAPI from SOAP service.
  5. Click Upload file.
  6. Select the AccountService.wsdl file from your file system
  7. Specify the service to include, and then create the API definition.
    1. Select the AccountService SOAP service and then click Add a product.
    2. In the Title field, enter User Services.
    3. Leave the Name and Version fields unchanged.
    4. Ensure that the Publish this product to a catalog check box is selected and then select Sandbox as the target Catalog.
      New Product details
    5. Click Done. The Design tab for the draft of your API definition opens.

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

To add your SOAP API to a Product and Plan, and then test it, complete the following steps:

  1. Click the Assemble tab. The assemble view opens.
  2. Click the Test icon The Test icon. The test tool opens.
  3. If you have used the test tool before, click Change setup.
  4. In the Catalog field, select your Sandbox Catalog.
  5. In the Product field, select your User Services Product and then click Republish product to publish your Product so that it can be tested.
  6. Click Next.

    Notice that the Setup section indicates that automatic subscription is used: Sandbox, User Services 1.0.0, using automatic subscription. Automatic subscription is enabled by default for the Sandbox Catalog; so you do not have to specify a Plan or application when testing. A test application which is automatically subscribed to all the Plans in the Catalog will be used, with a pre-supplied client ID and client secret.

  7. In the Operation field, select getBalance.
  8. 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 3. However, unlike the SOAP service, the API requires identification using a Client ID, which is enforced by the gateway server.
  9. 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.

What you did in this tutorial

In this tutorial, you completed the following activities:

  • Created a SOAP API
  • Tested your SOAP API