???HTTP?WCF??,????????????,??????????/???????,??????WCF? HTTP.SYS ??????HTTP???

???,????????,????????,??????,??????? NetTcpBinding????????????

??????HTTP.SYS,???????WCF????,??????,??????????????HTTP???

有帮助吗?

解决方案

WCF HTTP based bindings are dependent on HttpListener class which is managed wrapper around HTTP API. HTTP API is dependent on the way how operation system process http requests. So if you use operation system which uses http.sys driver (Windows 2003 and newer) you are dependent on it.

Edit:

Based on very good argument about Cassini I spent two hours in Reflector. Following description is only my assumption. I haven't found any information about it so maybe I'm completely wrong.

WCF internally contains some abstract class called HttpTransportManager this class is derived by internal classes HostedHttpTransportManager and SharedHttpTransportManager (this one also exists in version for HTTPS). The former one is not dependent on HttpListener but the latter one is. The former one is used when WCF is hosted in ASP.NET pipeline - internal classes HttpModule and HttpHandler from System.ServiceModel.Activation assembly use HostedHttpRequestAsyncResult dependent on HostedHttpTransportManager. The later one is used when HttpChannelListener is created (self-hosting).

My conclusion is that WCF service hosted in ASP.NET pipeline is not directly dependent on http.sys but the IIS hosting the pipeline is. This allows creating custom web server which will not be dependent on http.sys but will be able to host ASP.NET and so WCF. I think this is what Cassini does. Self hosted WCF service is always dependent on http.sys.

As I written above this is only my guessing based on some quick reverse engineering.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top