You are currently offline, waiting for your internet to reconnect

FIX: "Access Denied" Error Loading Local XML File When ServerHTTPRequest Property Is True

Symptoms
When you attempt to load a locally hosted XML file into an XMLDOMDocument object and the ServerHTTPRequest property of the document is set to True, you may receive the following error message:
Access Denied
You do not expect to be denied access to the file, because the file is hosted locally.
Resolution
This bug was corrected in XML 3.0 Service Pack 1.

To work around the problem, follow these steps:
  1. Run the WinHTTP Proxy Configuration Utility (Proxycfg.exe) to configure the registry for ServerHTTPRequest.If you are not using a proxy server, use the following command from a command prompt:
    proxycfg -d
    If you want to specify a proxy server, use the following command:
    proxycfg -d -p proxyserver "<local>"
  2. From a command prompt, run the following command to recycle and restart Internet Information Server (IIS):
    iisreset
Note that the local XML document loads without error if the Application Protection setting for the virtual directory in IIS is set to Low; that is, if the application is running within the IIS process memory space.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in XML 3.0 Service Pack 1.

For additional information on other fixes included in Microsoft XML 3.0 Service Pack 1, click the article number below to view the article in the Microsoft Knowledge Base:
292935 INFO: List of Issues Fixed in Microsoft XML 3.0 Service Pack 1
For the latest information and downloads of MSXML, refer to the following MSDN Web site at:
More information
To load an XML document from a server that is located behind a firewall, with the ServerHTTPRequest property set to True, you must first run the WinHTTP Proxy Configuration Utility (Proxycfg.exe). However, if the XML document is loaded from a server that is not behind a firewall, you should not need to first run Proxycfg.exe, even if you only use the proxycfg -d command.

Steps to Reproduce Behavior

To properly reproduce the error, use a system on which Proxycfg.exe has not been run.
  1. Create the test XML document.
    1. Create a new text document by using Microsoft Notepad or another text editor.
    2. Paste the following code into the new text document:
         <?xml version="1.0"?>   <bookstore>        <book>    	<title>Where's Where in Charlotte</title>      	<author>Irina Vinzovskaia</author>       </book>   </bookstore>						
    3. Save the text file as C:\INETPub\Wwwroot\Q291841.xml.
  2. Create an Active Server Pages (ASP) page to load the XML document.
    1. Create a new text document by using Microsoft Notepad or another text editor.
    2. Paste the following code into the new text document:
         <%   Set oXMLDoc = Server.CreateObject("MSXML2.DOMDocument.3.0")   oXMLDoc.setProperty "ServerHTTPRequest", true   oXMLDoc.async=False   oXMLDoc.load "http://localhost/Q291841.xml"   if oXMLDoc.parseError.reason <> "" then       Response.Write "XML load failed: " & oXMLDoc.parseError.reason   else       Response.Write "XML load succeeded!"   end if   %>						
    3. Save the file as C:\Inetpub\Wwwroot\Q291841.asp.
  3. For testing purposes, in the Internet Services Manager, configure Application Protection of the virtual root to High (Isolated) (out of process) or Medium.
  4. Browse to http://localhost/Q291841.asp.
The load fails with the error listed in the "Symptoms" section.
References
For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:
281142 PRB: Load Method Fails When Loading XML File Over HTTP
289481 HOWTO: Proxy Configuration Must Be Run for ServerXMLHTTP to Work
proxycfg proxy config proxyconfig
Properties

Article ID: 291841 - Last Review: 06/22/2014 11:05:00 - Revision: 2.0

  • kbbug kbfix kbmsxml300sp1fix kbmsxmlnosweep KB291841
Feedback
gif?DI=4050&did=1&t=">