XMLDocument no longer works

dbrennan
Kilo Contributor

I recently upgraded my instance to Istanbul.   After doing that the sensor script I had in my SOAPMessage Activity suddenly stopped working.   The error message I receive is org.mozilla.javascript.WrappedException:Wrapped ReferenceError "XMLDocument" is not defined.

The script is supposed to get the response from a SOAP API call and then parse it and display if it was successful or a failure and give the reason why it failed.

It seems like XMLDocument is no longer available for use in Istanbul?   I am looking at the documentation for Istanbul though and it XMLDocument should work...

Here is the problem code:

var responseXML = new XMLDocument(activity.output, true);

gs.log(activity.output);

//get the login id for the user

var name = responseXML.getNodeText("//*[name()='ns:loginId']");

//determin if the request was successful or not

var status = responseXML.getNodeText("//*[name()='ns:responseStatus']");

//get the reason for failure or a message stating the request completed successfuly

var respMsg = responseXML.getNodeText("//*[name()='ns:responseMsg']");

.

.

.

Any idea what the issue is?   This script worked fine in Fuji but that is not the case in Istanbul.

Thanks,

Devlin

1 ACCEPTED SOLUTION
8 REPLIES 8

andrewwaites
Tera Contributor

I have not had to use the XMLDocument object in Instanbul yet. But according to this documentation it is available.


XMLDocument script object



What are you seeing that is suggesting the XMLDocument is the problem?


dbrennan
Kilo Contributor

I keep receiving the error message: org.mozilla.javascript.WrappedException:Wrapped ReferenceError "XMLDocument" is not defined



This is leading me to believe that something is wrong with XMLDocument as I have not changed my script in any way and it worked fine in Fuji but doesn't work at all in Istanbul.



The SOAPMessage Activity that I have this sensor script placed in make the API call correctly but when I try to use XMLDocument to parse the response, it suddenly doesn't work after this upgrade.


sergeypovisenko
Giga Contributor

try to use this:


var responseXML = new global.XMLDocument(activity.output, true);


I tried that but now I get an error saying it's out of scope.   By the way, I am working within my own personal application scope, not in the global scope.



The specific error message now is: Illegal access to private script include XMLDocument in rhino.global being called from scope <my application scope here>



any ideas?