Article ID: 291008 - Last Review: November 19, 2001 - Revision: 1.2 PRB: "Access Denied" Error Message When Using ServerXMLHTTP to Access an Authenticated SiteThis article was previously published under Q291008 SYMPTOMS
When you use the ServerXMLHTTP object to access a Web site that is configured to use Integrated Windows authentication, and a valid NT User ID and password are not supplied in the call to the Open method of the ServerXMLHTTP object, you may receive the following error message:
401 - Access Denied
However, when you use the ServerXMLHTTP object, the error can also occur when the NT User ID (under whose credentials the ServerXMLHTTP object code is executing) has the rights that are required to execute the HTTP operation that is specified as the first parameter of the object's Open method. CAUSE
The Microsoft XML Parser (MSXML) 3.0 installs and depends on Microsoft Windows HTTP Services (WinHTTP). If the WinHTTP proxy configuration settings that are required by the ServerXMLHTTP object have not been set or have been incorrectly set on the computer on which the ServerXMLHTTP code is being executed, the error occurs.
RESOLUTION
Use the WinHTTP proxy configuration utility (Proxycfg.exe) to set the WinHTTP proxy configuration settings correctly as required.
STATUS
This behavior is by design.
MORE INFORMATION
The proxy configuration utility allows you to configure WinHTTP proxy settings that are required by the ServerXMLHTTP object. This object relies on WinHTTP to establish server-to-server HTTP connections. When you use ServerXMLHTTP code to execute HTTP operations against a Web site, you often receive the 401 - Access Denied HTTP error message when one of the following two conditions is true:
289481
(http://support.microsoft.com/kb/289481/EN-US/
)
INFO: Proxy Configuration Utility Must Be Run for ServerXMLHTTP to Work
When you use MSXML 3.0, if Proxycfg.exe has not been run, the ServerXMLHTTP object defaults to accessing sites directly. This is the equivalent to running the proxycfg -d setting, which configures WinHTTP to use a non-proxy setup. In MSXML 3.0, ServerXMLHTTP requires Proxycfg.exe to be run even when there is no proxy server or, more specifically, where the process does not have write permissions to the registry (this is typically the case for the IWAM_machinename user account under which out-of-process ASP applications run).
The 401-Access Denied HTTP error may also occur under the following conditions:
The following Knowledge Base article describes settings that can correct the problem if the environment uses a proxy server: 289481
(http://support.microsoft.com/kb/289481/EN-US/
)
INFO: Proxy Configuration Utility Must Be Run for ServerXMLHTTP to Work
NOTE: If the environment does not use a proxy server, the settings that are described in the above article will not fix the problem that is described in the "Symptoms" section.
If you want to use the ServerXMLHTTP auto logon feature in an environment that does not use a proxy server (to access a site that is configured to use Integrated Windows authentication), you should set the Proxycfg.exe settings using a command identical to the following. Include the name(s) of the Intranet IIS Servers against which you wish to execute HTTP operations using the ServerXMLHTTP object in the semicolon (;) separated proxy bypass list: Alternatively, explicitly supplying the NT username and password in the call to the Open method of the ServerXMLHTTP object as shown in the following example also fixes the problem: REFERENCES
| Article Translations
|
Back to the top
