- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2017 07:57 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2017 10:44 AM
hmmm
Is XMLDocument2(https://developer.servicenow.com/app.do#!/api_doc?v=helsinki&id=c_XMLDocument2ScopedAPI) appropriate for you?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2017 08:27 AM
I have not had to use the XMLDocument object in Instanbul yet. But according to this documentation it is available.
What are you seeing that is suggesting the XMLDocument is the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2017 08:47 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2017 10:20 AM
try to use this:
var responseXML = new global.XMLDocument(activity.output, true);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2017 10:40 AM
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?