Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

...

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

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

Image Added