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
Follow this tutorial to create an API in API Manager by importing the WSDL for an existing SOAP
service. Both SOAP 1.1 and SOAP 1.2 standards are supported by API Connect. When invoked,
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 a fictional bank account for a particular user.
Before you begin
Note: The Sandbox catalog must be configured to use either a
DataPower® API
Gateway, or a
DataPower Gateway (v5
compatible), or both. See
Creating and configuring Catalogs.
Creating a SOAP API
To create an API for an existing SOAP service, complete the following steps.
- Download the SOAP WSDL file AccountService.txt. Rename this file AccountService.wsdl.
- Log in to the API Manager UI.
- Click the Develop APIs and Products tile.

- Click .

- Ensure that OpenAPI 2.0 is selected.
- Select From existing WSDL service (SOAP proxy). Click
Next.

- In the File Upload section, either drag and drop the
AccountService.wsdl file, or click to upload from your filesystem.

- The file uploads, and is parsed by API Connect. A confirmation
message is displayed. Click Next to continue.
- Select the AccountService WSDL service, and click
Next.

- Leave the values unchanged in the Info section, and click
Next.

- In the Secure section, select the Limit API calls on a per key
basis checkbox, and in the Activate API section, select the
Activate API checkbox. Click Next.

- A Summary screen is now displayed, showing the steps to create and publish
your new API. When this process is complete, you see a summary of the results, including the API
Base Endpoint, and the credentials of the Sandbox Test Application that is automatically subscribed
to the new API.

- Click Edit API. Your new SOAP API is now online.

You successfully created a SOAP API, and included it in a Product and Plan. The WSDL file
provided all the information that was needed to configure the API 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 test your SOAP API, complete the following steps.
- Click the Assemble tab of the AccountService API, to
move to the Assemble view, and then click the Test icon
.
Note that the policy for the API is an
Invoke policy if you are using the DataPower API
Gateway, and is a
Proxy policy if you are using the DataPower Gateway (v5
compatible). For more
information about policies, see Built-in
policies.
Also note that the test panel is being deprecated, and will be moved to the
Test tab in a future release.
- The Test panel opens, and you can see that the default Product and Plan
that are needed for the test setup are listed.

- In the Operation section, select the post
/getBalance operation to invoke.

- Scroll down to the Parameters section, and enter the following request
body into the Body
field:
<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="https://apictutorials.mybluemix.net/">
<arg0>3</arg0>
</ban:getBalance></SOAP-ENV:Body></SOAP-ENV:Envelope>
This
request body requests the balance of the account identified by the arg0 node, and
is the same as would normally be passed to the SOAP endpoint. However, unlike the SOAP service, the
API requires identification by using a Client ID, which is enforced by the gateway server. 
- Click Invoke to test the API. The API response is displayed in the
Response section. If you receive a message relating to an untrusted
certificate, click the link provided, accept the certificate, then return to the test environment
and click Invoke again.

The
Response section successfully returns the balance of the account.
What you did in this tutorial
In this tutorial, you completed the following activities:
- Created a SOAP API definition.
- Tested your SOAP API.