ASP classic debugging is a disgusting topic that millions of foreign brain cells have sacrificed over the years. Even with tools designed to develop and / or support classic ASP, allowing debugging can be difficult.
If your efforts are a relatively small one-time thing, as your question suggests, then it probably doesn’t make sense to spend a lot of time setting up and setting up an advanced ASP / script debugging environment. Instead, as per Pete Duncanson’s answer, just insert a few Response.Write statements into your script and find out where and why it doesn't work the old fashioned way. However, one thing Pete did not point out is that you need to enable the VBScript error handler (actually, the swallower error) to avoid throwing an unhandled exception, resulting in IIS serving 500 people.
I set up and ran the following code and it worked fine (i.e. no errors). The XML URL pointed to a simple file in the same virtual directory on the local computer as the ASP page, and contained the XML found in AnthonyWJones answer. (By the way, I have no idea how you got your VBScript so well formatted in the original question, so my copy looks pretty bad.)
<% On Error Resume Next ' prevent tossing unhandled exception Dim URL, objXML, value URL = "http://someserver.com/xml" Set objXML = Server.CreateObject("MSXML2.DOMDocument.6.0") Response.Write "after CreateObject: " & Err.Description & "<br>" objXML.setProperty "ServerHTTPRequest", True Response.Write "after setProperty: " & Err.Description & "<br>" objXML.async = False Response.Write "after async: " & Err.Description & "<br>" objXML.Load URL Response.Write "after Load: " & Err.Description & "<br>" Response.Write objXML.parseError.reason Response.Write "after write of parseError.reason: " & Err.Description & "<br>" value = objXML.documentElement.Text Response.Write "after setting value: " & Err.Description & "<br>" set objXML = nothing %> <%= value %>
Open this in IE or Firefox, and if all goes well, you should see this:
after CreateObject:
after setProperty:
after async:
after Load:
after write of parseError.reason:
after setting value:
The value
Of course, everything will not be fine, otherwise you will not be here, and in this case you should see that the error data appears at some point after one of the Response.Write values. Here is more information about the VBScript Err object.
Good luck
source share