问题
just when I finally understood the difference between Msxml2.XMLHTTP and Msxml2.ServerXMLHTTP
http://support.microsoft.com/kb/290761
XMLHTTP is designed for client applications and relies on URLMon, which is built upon Microsoft Win32 Internet (WinInet). ServerXMLHTTP is designed for server applications and relies on a new HTTP client stack, WinHTTP. ServerXMLHTTP offers reliability and security and is server-safe. For more information, see the MSXML Software Development Kit (SDK) documentation.
suddenly I find WinHttp.WinHttpRequest...
http://msdn.microsoft.com/en-us/library/aa382925(VS.85).aspx
Microsoft Windows HTTP Services (WinHTTP) provides developers with a server-supported, high-level interface to the HTTP/1.1 Internet protocol. WinHTTP is designed to be used primarily in server-based scenarios by server applications that communicate with HTTP servers.
so, how is this different from Msxml2.ServerXMLHTTP
(well, the implicit question is which one should I use...)
回答1:
Msxml2.XMLHTTP and Msxml2.ServerXMLHTTP are two components share the similar interface for fetching XML files over HTTP protocal. The former is built upon URLMon, which relies on WinINet. The later is built upon WinHTTP, which is a server friendly replacement for WinINet. To put it simple - ServerXMLHTTP = XML + WinHTTP.
回答2:
Similarly a recent application has found me asking similar questions, however after performing some rudimentary research I have simplified as follows:
WinHTTP :: high-level interface to the HTTP/1.1 Internet protocol
ServerXMLHTTP :: ServerXMLHTTP is recommended for server applications and XMLHTTP is recommended for client applications
Depends what you are doing and how much control you require.
Explicitly denied elements of ServerXMLHTTP often cause some developers annoyances as it requires a little more 'work' to implement effectively. The helping-hand with the explicitly allowed WinHTTP and XMLHTTP objects is not there with ServerXMLHTTP.
If your solution requires elements of Enterprise up-scaling, out-scaling then perhaps choose appropriately.
回答3:
We were using both of these components in classic ASP web applications. There were called a LOT of times every minute, from server to server asp server-side page calling another asp or aspx server-side page).
Server.CreateObject("WinHttp.WinHttpRequest.5.1")
Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
Our experience is that WinHttpRequest is stable, the other is not. We had to remove all our createobject to serverxmlhttp and replace them by winhttprequest, because after a while, it was taking lot of memory, was freezing, or the iis application pool did not respond or became very slow.
I don't know the detailed specifications of each components, but I can assure you that, from our experience, "MSXML2.ServerXMLHTTP.6.0" is the one to use.
来源:https://stackoverflow.com/questions/1163045/differences-between-msxml2-serverxmlhttp-and-winhttp-winhttprequest