...
- 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.
We use 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 Implement to proceed to the implementation phase.
FieldSample valueName SoapTest Context /soaptest
Version 1.0 - Click the Managed API option.
Select Endpoint type as HTTP/SOAP endpoint, provide the production endpoint, which is http://ws.cdyne.com/phoneverify/phoneverify.asmx in this example, and click Manage.
Note Alternatively, in the implementation stage, you can deploy the API as a prototype. APIs are deployed as Prototypes for testing purposes. If you deploy the API as a prototype, you will be able to invoke the API without subscriptions. Refer Create a Prototyped API with an Inline Script for more information on deploying APIs as prototypes.
For additional information see Enabling CORS for APIs and Adding Mediation Extensions.
For additional information on API Endpoint Security, see API Endpoint Security.In the Manage tab, select the
Gold
tier, scroll down and click Save and Publish.Note If you wish want to add scopes to resource got createdresources, click on add scopes Add Scopes and specify the scopes you want to add. If you specify a scope, you need be sure to use the same scope scopes when generating an access token for the subscribed application and when invoking the API. Refer OAuthscopes for 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 Note that when creating this API, under Advanced Throttling Policies we are keeping the default which is Apply per Resource. For more information on setting Advanced Throttling Policies refer Enforce Enforcing Throttling and Resource Access Policies.
When prompted, choose to open the newly published API in the API Store.
Note Alternatively you can Login to the store and see the newly created API. Click on the newly published API.
- 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 it using the SOAP UI. - Download the SOAP UI installation that suits your operating system from https://www.soapui.org/downloads/soapui.html and open its console.
- In the SOAP UI, right click on the Projects menu and create a new SOAP project.
- Give your API's WSDL and click OK. In this case, the WSDL is http://ws.cdyne.com/phoneverify/phoneverify.asmx?wsdl.
The WSDL defines two operations. Let's work with
CheckPhoneNumber
. Double clickRequest 1
. As this API is protected by OAuth, add an authorization header to your request by clicking the add sign on the Header tab of the console.Add the following values and submit the request:
Give the value of the Authorization header that you added in the previous step as 'Bearer <the access token in step 9>.
Change the endpoint in the SOAP UI to the production URL of the API. You can copy the production URL from the API's Overview tab.
Give any value (say 18006785432) as the
PhoneNumber
and 0 as theLicenseKey
.
Note that the response appears in the SOAP UI.
You have invoked the API using a SOAP client. Let's invoke the same API using the integrated Swagger console in the API Cloud.
- 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 Code Block <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:quer="http://ws.cdyne.com/PhoneVerify/query"> <soapenv:Header/> <soapenv:Body> <quer:CheckPhoneNumber> <!--Optional:--> <quer:PhoneNumber>18006785432</quer:PhoneNumber> <!--Optional:--> <quer:LicenseKey>0</quer:LicenseKey> </quer:CheckPhoneNumber> </soapenv:Body> </soapenv:Envelope>
SOAP Action http://ws.cdyne.com/PhoneVerify/query/CheckPhoneNumber - Note the API response that appears on the console.
...