Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 291841 - Last Review: October 16, 2002 - Revision: 1.3
FIX: "Access Denied" Error Loading Local XML File When ServerHTTPRequest Property Is True
This article was previously published under Q291841
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:
You do not expect to be denied access to the file, because the file is hosted locally.
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 "<local>"
- 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.
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Â
(http://kbalertz.com/Feedback.aspx?kbNumber=292935/EN-US/
)
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:
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="1.0"?>
<bookstore>
<book>
<title>Where's Where in Charlotte</title>
<author>Irina Vinzovskaia</author>
</book>
</bookstore>
- Save the text file as C:\INETPub\Wwwroot\Q291841.xml.
- 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.
- 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
%>
- Save the file as C:\Inetpub\Wwwroot\Q291841.asp.
- For testing purposes, in the Internet Services Manager, configure
Application Protection of the virtual root to High (Isolated) (out of process) or Medium.
- Browse to http://localhost/Q291841.asp.
The load fails with the error listed in the "Symptoms" section.
For additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
281142Â
(http://kbalertz.com/Feedback.aspx?kbNumber=281142/EN-US/
)
PRB: Load Method Fails When Loading XML File Over HTTP
289481Â
(http://kbalertz.com/Feedback.aspx?kbNumber=289481/EN-US/
)
HOWTO: Proxy Configuration Must Be Run for ServerXMLHTTP to Work
| kbbug kbfix kbmsxml300sp1fix kbmsxmlnosweep KB291841 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate