Freigeben über


ServerHTTPRequest Property

 

Specifies whether to enable (true) or disable (false) the use of the ServerHTTPRequest object in a server application. Setting the property to false causes the DOM object not to use the HTTPRequest object. Setting this property to true causes DOM documents to use ServerHTTPRequest.

This property is supported in MSXML 3.0 and 6.0. The default value is false.

Script Syntax

domObj.setProperty(strProp, vBool);  
vBool = domObj.getProperty(strProp);  

Visual Basic Syntax

domObj.setProperty
(strProp, vBool)  
vBool = domObj.getProperty
(strProp)  

C\C++ Syntax

HRESULT setProperty(BSTR strProp, VARIANT vBool);  
HRESULT getProperty(BSTR strProp, VARIANT* vBool);  

Parameters

strProp
A BSTR string whose value is "ServerHTTPRequest".

vBool
A VARIANT_BOOL value of true or false.

Remarks

Setting this property to true means that WinHTTP.dll is used. Setting this property to false means that the WinInet component is used instead. WinHTTP is server-safe, but it lacks support for asynchronous mode and is unavailable in earlier versions of Microsoft Windows, such as Windows 98 and Windows Me. WinInet is widely available but unsafe in multi-thread and server environments.

In general, you must use WinHTTP with MSXML in any context where the URLMON system class (part of WinInet) is not supported or is not well supported. For example, URLMON is not supported for file download in an ASP page. Therefore, you need to set the ServerHTTPRequest property to true if you must handle XML file downloads from within an ASP page. See the document function of XSLT for more information. Also, WinHTTP is recommended in highly multi-threaded scenarios because WinHTTP handles the situation better than URLMON.

Because WinHTTP only supports synchronous loading, the async property must be set to false when the ServerHTTPRequest property is set to true.

For example:

<%@language=JScript%>  
<%   
var xmldoc;  
xmldoc = Server.CreateObject("Msxml2.DOMDocument.6.0");  
xmldoc.async = false;  
xmldoc.setProperty("ServerHTTPRequest", true);  
xmldoc.load("http://myserver.com");  
%>  

Important

For servers running on an Intranet, the ServerHTTPRequest property requires that you run a proxycfg.exe utility to configure WinHTTP's proxy settings. They cannot be configured through the Microsoft Windows Control Panel.

Note

Using the WinHTTP Proxy Configuration Utility. After you have run the proxycfg.exe tool and updated the registry, the previous registry settings cannot be restored.

Note

The ServerHTTPRequest functionality is provided by the WinHTTP APIs in the winhttp5.dll file. To function properly, the winhttp5.dll file must be in the system path, typically located in %windir%\system32.

Versioning

This property is supported in MSXML 3.0 and 6.0. The default value is false.

Applies to

Interface: IXMLDOMDocument2

Methods: setProperty | getProperty