Microsoft KB Archive/291841

= FIX: &quot;Access Denied&quot; Error Loading Local XML File When ServerHTTPRequest Property Is True =

Article ID: 291841

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft XML Core Services 4.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:  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 &quot; &quot;

 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:

http://msdn.microsoft.com/xml/default.asp



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.  Create the test XML document.  Create a new text document by using Microsoft Notepad or another text editor.  Paste the following code into the new text document: <?xml version=&quot;1.0&quot;?> Where's Where in Charlotte Irina Vinzovskaia </li> Save the text file as C:\INETPub\Wwwroot\Q291841.xml.</li></ol> </li> Create an Active Server Pages (ASP) page to load the XML document.  Create a new text document by using Microsoft Notepad or another text editor.</li>  Paste the following code into the new text document: <%  Set oXMLDoc = Server.CreateObject(&quot;MSXML2.DOMDocument.3.0&quot;) oXMLDoc.setProperty &quot;ServerHTTPRequest&quot;, true oXMLDoc.async=False

oXMLDoc.load &quot;http://localhost/Q291841.xml&quot;

if oXMLDoc.parseError.reason <> &quot;&quot; then Response.Write &quot;XML load failed: &quot; & oXMLDoc.parseError.reason else Response.Write &quot;XML load succeeded!&quot; end if  %> </li> Save the file as C:\Inetpub\Wwwroot\Q291841.asp.</li></ol> </li> For testing purposes, in the Internet Services Manager, configure Application Protection of the virtual root to High (Isolated) (out of process) or Medium.</li> Browse to http://localhost/Q291841.asp.</li></ol>

The load fails with the error listed in the &quot;Symptoms&quot; section.

<div class="references_section">