I want to read a specific value in the XML returned by the APIC Invoke policy (from a SOAP service), in a gateway script.
I have searched high and low. I have tried this and that from my searches. Result: I failed miserably.
I thought apim.readInputAsXML(function(error, xmlNodelist) was the answer, but was puzzled when I realised that I was reading the input to the API. I'm new to JavaScript and have concluded that 'xmlNodeList' I was processing was actually created by the 'readInputAsXML' (and not one I thought I was passing as parameter) Duh! I suppose the word 'input' gives it away.
I have found 'readAsXML()', but not what kind of object it operates on.
var xmlNodeList = apim.getvariable('response.body') seemed to work at first, and the type is 'object Nodelist', the same as when using 'readInputAsXML'.
However, the object returned by 'xmlNodelist.item(0)' is a blob (type=13). This contrasts with 'readInputAsXML', where this is a node with name 'Envelope'.
Can anyone help with an explanation or pointing me at a reference?
BTW, this is APIC 2018.3.7