SOAP generic examples

To parse SOAP messages iHub uses https://www.npmjs.com/package/xmldom this can either be used by using mustache function "{{{getElementByTagNameNS payload 'http://www.dataaccess.com/webservicesserver/' 'NumberToWordsResult' 0}}}" or scripted variables.

Number Example

https://www.dataaccess.com/webservicesserver/NumberConversion.wso

Sending SOAP

To run the convert number soap api, create a new Web Action like below.

POST: https://www.dataaccess.com/webservicesserver/NumberConversion.wso

Change the Content-Type to value text/xml header and add the SOAPAction header with value http://schemas.microsoft.com/sqlserver/2004/SOAPsqlbatch

Reading SOAP

This example we created a issue comment which the body "{{{getElementByTagNameNS payload 'http://www.dataaccess.com/webservicesserver/' 'NumberToWordsResult' 0}}}"

This will take the response from the first call and read the value and add it as a comment on the issue.

We used the Issue Commented template below for “Add new action”

 

For more advanced parsing of messages use ScriptedVariable

Here is an example of the same function that the mustache uses but in script

const xmlDoc = domParser.parseFromString(response.data, 'text/xml'); const resultNode = xmlDoc.getElementsByTagNameNS('http://www.dataaccess.com/webservicesserver/', 'NumberToWordsResult')[0]; return resultNode.textContent.trim();