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



The information in this article applies to:

  • Microsoft XML 3.0

This article was previously published under Q291841

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

For more information, see the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbDSupport KbMSXML300SP1fix kbMSXMLnosweep KB291841