WSO2 API Manager supports the management of both REST and SOAP APIs.
In this tutorial, we create and publish an API with a SOAP endpoint and then invoke it using the integrated API Console and a third-party tool (SOAP UI).
Let's get started.
- Log in to the API Publisher and click ADD NEW API.
Select the option to design an API with an existing SOAP endpoint, give the endpoint URL and click Start Creating.
This example uses the WSDL http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl from CDYNE as the endpoint here, but you can use any SOAP backend of your choice.
The Design tab of the API opens. Give the information in the table below and click Next: Implement > to proceed to the implementation phase.FieldSample value
Name SoapTest Context
- Click the Managed API option.
- Select HTTP/SOAP Endpoint, provide the production endpoint, which is http://ws.cdyne.com/phoneverify/phoneverify.asmx in this example, and click Manage.
In the Manage tab, select the Gold tier, scroll down and click Save and Publish.
If you wish to add scopes to the resources that were created, click Add Scopes and specify the scopes you want to add. If you specify a scope, you need to use the same scope when generating access tokens for the subscribed application and when invoking the API. For more information on working with the scopes, see OAuthscopes.
You have now published the SOAP API to the API Store. Let's subscribe to it.
Note that when creating this API, the default option, Apply per Resource, was selected under Advanced Throttling Policies. For more information on setting advanced throttling policies, see Enforce Throttling and Resource Access Policies.
For more information on API authentication (e.g., non authentic API invocation), see HTTP methods.
- Log in to the API Store and open the newly created API from the store.
- The SoapTest API opens. Select an application (e.g., DefaultApplication), the Gold tier and subscribe to the API.
- Click the APPLICATIONS menu and click the Production Keys tab. If you have an access token already generated, scroll down and click Re-generate. By default, access tokens expire an hour after creation, unless you change the expiration time.
You have now subscribed to an API in the API Store. Let's invoke the API.
- Back in the API Store, click the API to open it and go to its API Console tab.
Expand the POST method, enter the following, and invoke the API.
SOAP Request SOAP Action http://ws.cdyne.com/PhoneVerify/query/CheckPhoneNumber
Note the API response that appears on the console.
In this tutorial, you have created an API with a SOAP backend and invoked it using both the integrated Swagger API Console in the API Manager, as well as an external tool.
You can invoke this API using a third party tool, such as SOAP UI, as well. For more information on how to invoke an API using a SOAP client, see Invoke an API using a SOAP Client.