PRB: Users Are Prompted for Credentials When Using XMLHTTP or ServerXMLHTTP to Access Remote Pages (309436)



The information in this article applies to:

  • Microsoft XML 2.0
  • Microsoft XML 2.5
  • Microsoft XML 2.6
  • Microsoft XML 3.0
  • Microsoft XML 3.0 SP1
  • Microsoft XML 3.0 SP2
  • Microsoft XML 4.0

This article was previously published under Q309436

SYMPTOMS

Users of applications that use the XMLHTTP or ServerXMLHTTP objects to access a remote Web page or XML document may be prompted for credentials when the objects open a connection to a remote server, even though the remote server does not require authentication.

CAUSE

The ServerXMLHTTP request passes through a proxy server that requires client authentication.

MORE INFORMATION

The ServerXMLHTTP component in versions of the MSXML parser earlier than 4.0 does not support proxy authentication. No versions of XMLHTTP, including version 4.0, support proxy authentication.

The ServerXMLHTTP object in the MSXML 4.0 parser includes two new members to support proxy configuration and authentication: setProxy and setProxyCredentials.

The setProxyCredentials Method

The setProxyCredentials method is used to specify proxy authentication credentials. The setProxyCredentials method accepts the following two arguments:
  • username: The name of the user that is to be authenticated.
  • password: The password for the user that is to be authenticated.

The setProxy Method

The setProxy method is used to set the proxy configuration that is used by ServerXMLHTTP. The setProxy method accepts the following three parameters:
  • proxySetting: The proxy configuration whose value is to be set. The values are shown in the table below.
  • varProxyServer: The name of a proxy server or a list of proxy server names.
  • varBypassList: The list of locally known host names or IP addresses for which you want to permit bypass of the proxy server.

The following settings are available for use with the setProxy method:

SettingOptionDescription
0SXH_PROXY_SET_PRECONFIG

-or-

SXH_PROXY_SET_DEFAULT
The SXH_PROXY_SET_PRECONFIG option can specify that a previously established static proxy configuration should be used. When this option is used, the configuration is taken from the Windows registry. This is the case if you use the WinHTTP proxy configuration utility, Proxycfg.exe, to set proxy settings at the client computer.

Currently, SXH_PROXY_SET_DEFAULT shares the same settings level as SXH_PROXY_SET_PRECONFIG. It is intended, however, to support auto-proxy configuration features that may be included with future released products.
1SXH_PROXY_SET_DIRECTThe SXH_PROXY_SET_DIRECT option can specify that all HTTP and HTTPS servers should be accessed directly.
2SXH_PROXY_SET_PROXYThe SXH_PROXY_SET_PROXY option can specify one or more proxy servers and an optional bypass list. If a proxy is not specified for a given protocol, and the server is not in the bypass list, the server cannot be accessed.

Modification Type:MajorLast Reviewed:11/27/2001
Keywords:kbprb KB309436