The SOAP component allows connecting to an existing WSDL service. This allows you to expose the service as REST API or use the component data in service flow for more advanced service logic.
In the SOAP Service section you need to enter the service URL. Once you enter the URL click the Retrieve buttons. This will ask API Express to learn about the service and automatically populate the Service drop down.
Select a service from the Service list. Once a service is selected, the Port list will be populated. Select a port and then select an operation. The Operation list will also be automatically populated.
When the operation is selected the Request Body and http://www.w3schools.com/xml/tempconvert.asmx?WSDL sections will be filled the correct request body.
First time here? Try this quickstart tutorial.
You can enter an optional header parameter and map it to any Components Data variables.
result = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">' + '<soapenv:Header/>' + '<soapenv:Body>' + '<ns:FahrenheitToCelsius xmlns:ns="http://www.w3schools.com/xml/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' + '<ns:Fahrenheit>' + PARAMS.QUERY.temperature + '</ns:Fahrenheit>' + '</ns:FahrenheitToCelsius>' + '</soapenv:Body>' + '</soapenv:Envelope>';
In the code example above, PARAMS.QUERY.temperature is inserted as a parameter.
This section will be automatically filled when you select an operation.
This section has a number of samples using the SOAP component:
When a SOAP services is secured with Basic Authentication, here is how to use it in API Express:
- Create an administrator user in Users collection (Appery.io database).
- Upload your WSDL file into the Files collection.
- Specify that only administrator user can have access to this file (via ACL).
- Use the Master Key in WSDL URL for SOAP component. The URL will look like this: https://api.appery.io/rest/1/db/files/5617c3d1e4b01d89fb7656d9/5406f5d0......7a6bb.soap.wsdl?masterKey=<your_master_key>
- Add authentication header for SOAP request with username:password string in Base64 format.
- Header parameter name: Authorization.
- You are now ready to test and run the service.
This video example shows how to connect to an external SOAP service from the API Express.
Updated almost 3 years ago