html5中文学习网

您的位置: 首页 > 网络编程 > ASP编程 » 正文

XMLHTTP与ServerXMLHTTP的区别_ASP教程_编程技术

[ ] 已经帮助:人解决问题
在服务器端用ASP来取得互联网上的任意文件使用ServerXMLHTTP或许更加合适.可以设定过期时间可以让ASP程序更具效率和可靠性,如下表所示:
 

XMLHTTPh3iHTML5中文学习网 - HTML5先行者学习网

ServerXMLHTTPh3iHTML5中文学习网 - HTML5先行者学习网

1h3iHTML5中文学习网 - HTML5先行者学习网

Works on Windows 98, 95 and MEh3iHTML5中文学习网 - HTML5先行者学习网

Requires at least Windows NT 4 with IE5.01 .h3iHTML5中文学习网 - HTML5先行者学习网

2h3iHTML5中文学习网 - HTML5先行者学习网

 h3iHTML5中文学习网 - HTML5先行者学习网

Does not have a means of waiting for an async call other than using another thread to handle the response via onreadystatechange.h3iHTML5中文学习网 - HTML5先行者学习网

 h3iHTML5中文学习网 - HTML5先行者学习网

Another technique is to loop on the main thread, polling the readystate property.h3iHTML5中文学习网 - HTML5先行者学习网

For example:h3iHTML5中文学习网 - HTML5先行者学习网

 While xmlhttp.readystate <> 4h3iHTML5中文学习网 - HTML5先行者学习网

   ' async request not complete yet; still waitingh3iHTML5中文学习网 - HTML5先行者学习网

 Wendh3iHTML5中文学习网 - HTML5先行者学习网

 h3iHTML5中文学习网 - HTML5先行者学习网

But this is not as efficient as the ServerXMLHTTP's WaitForResponse methodh3iHTML5中文学习网 - HTML5先行者学习网

Has a waitForResponse method with a timeout when using async calls.h3iHTML5中文学习网 - HTML5先行者学习网

3h3iHTML5中文学习网 - HTML5先行者学习网

 h3iHTML5中文学习网 - HTML5先行者学习网

Allows configuring timeouts when sending messages.h3iHTML5中文学习网 - HTML5先行者学习网

4h3iHTML5中文学习网 - HTML5先行者学习网

Is designed for single-user, desktop applications, such as running in a browser-based app.h3iHTML5中文学习网 - HTML5先行者学习网

 h3iHTML5中文学习网 - HTML5先行者学习网

XMLHTTP's assumption that it is used only in single-user environments has security implications.h3iHTML5中文学习网 - HTML5先行者学习网

Do not use XMLHTTP in multi-user scenarios such as on IIS/ASP servers.h3iHTML5中文学习网 - HTML5先行者学习网

Also, in various cases, XMLHTTP may display UI dialogs (to collect credentials).h3iHTML5中文学习网 - HTML5先行者学习网

Supports multi-user, server-based applications, such as ASP apps.h3iHTML5中文学习网 - HTML5先行者学习网

5h3iHTML5中文学习网 - HTML5先行者学习网

Because XMLHTTP is designed for single-user client applications and is based on WinInet, it enforces strict limits on the number of simultaneous connections to a given server. h3iHTML5中文学习网 - HTML5先行者学习网

The limit is either 2 or 4 (depending on HTTP version).h3iHTML5中文学习网 - HTML5先行者学习网

The ServerXMLHTTP component does not impose any limits on the number of connections to a server.h3iHTML5中文学习网 - HTML5先行者学习网

6h3iHTML5中文学习网 - HTML5先行者学习网

XMLHTTP integrates with the IE browser's cache, which may cause problems in which "stale" response data is returned.h3iHTML5中文学习网 - HTML5先行者学习网

ServerXMLHTTP does not implement a cache.h3iHTML5中文学习网 - HTML5先行者学习网

7h3iHTML5中文学习网 - HTML5先行者学习网

XMLHTTP is HTTP/1.1 compliant.h3iHTML5中文学习网 - HTML5先行者学习网

XMLHTTP does support HTTP/1.1 chunking.h3iHTML5中文学习网 - HTML5先行者学习网

ServerXMLHTTP reports itself as an HTTP/1.0 client.h3iHTML5中文学习网 - HTML5先行者学习网

The reason is that ServerXMLHTTP does not support the HTTP/1.1 response "chunking" feature, which is required for 1.1 compliance.h3iHTML5中文学习网 - HTML5先行者学习网

8h3iHTML5中文学习网 - HTML5先行者学习网

By using the IE browser's proxy settings, XMLHTTP can take advantage of IE's auto-detection of proxy servers.h3iHTML5中文学习网 - HTML5先行者学习网

If IE is configured to access sites via a proxy server, then all requests made via XMLHTTP will also go through the proxy.h3iHTML5中文学习网 - HTML5先行者学习网

However, IE (and thus XMLHTTP) can be configured to bypass the proxy server for certain sites (assuming that a direct connection to the target server can be made).h3iHTML5中文学习网 - HTML5先行者学习网

This is done in the "Tools/Internet Options/Connections/LAN Settings" dialog in IE.h3iHTML5中文学习网 - HTML5先行者学习网

The "Bypass proxy server for local addresses" option should be checked to have the proxy server bypassed for intranet sites.h3iHTML5中文学习网 - HTML5先行者学习网

ServerXMLHTTP does not support any auto-detection or discovery of proxy servers; you must explicitly specify the name of the proxy server using the proxycfg.exe utility.h3iHTML5中文学习网 - HTML5先行者学习网

Can be configured with WinHTTP proxy config to access other machines directly (no proxy server).h3iHTML5中文学习网 - HTML5先行者学习网

9h3iHTML5中文学习网 - HTML5先行者学习网

The XMLHTTP component in MSXML 3.0 supports automatic gzip decompression;h3iHTML5中文学习网 - HTML5先行者学习网

ServerXMLHTTP does not.h3iHTML5中文学习网 - HTML5先行者学习网

由此可见在服务器端用ASP来取得互联网上的任意文件使用ServerXMLHTTP或许更加合适.可以设定过期时间可以让ASP程序更具效率和可靠性h3iHTML5中文学习网 - HTML5先行者学习网

h3iHTML5中文学习网 - HTML5先行者学习网
h3iHTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助