PRB: Load Method Fails When Loading XML File Over HTTP
This article was previously published under Q281142 On This PageSYMPTOMS
When you use the Load method of either the MSXML.DOMDocument or the MSXML2.DOMDocument object to load an XML file over HTTP, the method fails with this error message:
-2146697209 - No data is available for the requested resource.
RESOLUTION
Use the ServerXMLHTTP component (introduced in MSXML 3.0) to load the document.
You must use the setProperty method of MSXML2.DOMDocument to set the ServerHTTPRequest property to True. A value of True for the ServerHTTPRequest property indicates that you should use the "server-safe" ServerXMLHTTP component to load the document to the server. ServerXMLHTTP only supports synchronous loading; thus, the async property must be set to False when ServerHTTPRequest is set to True.
MORE INFORMATION
If the Load method points to a file path, the problem does not occur. In the virtual directory that contains the ASP page that loads the XML file, if anonymous access is allowed, be sure that the account used for anonymous access is a domain account. By default, Microsoft Internet Information Server (IIS) sets this account to a local server account, such as IUSR_MACHINENAME, which may not have sufficient rights to the XML file on the other server. If the IIS server does not have Microsoft Internet Explorer 5.01 Service Pack 2 (SP1) or later installed, the following result displays when you try to access the ASP page:
error 'ASP 0115' Unexpected error /MyVirtualDirectory/MyASPPage.asp A trappable error occurred in an external object. The script cannot continue running. Steps To Reproduce BehaviorThe following VBScript code causes the error message to occur:
To set the SetProperty method to True, add the following line to the preceding code, immediately following the line: oXML.async = False:
For servers that are running on an intranet, the ServerHTTPRequest property requires you to run the WinHTTP proxy configuration utility, Proxycfg.exe. You cannot configure these settings by means of Control Panel. Currently, the Proxycfg tool is only available by installing the following service packs or software:
REFERENCESMicrosoft
XML 3.0 Software Development Kit
APPLIES TO
| Article Translations
|
Back to the top
