probably a stoopid question

Topics: Web Api
Apr 19, 2011 at 2:49 PM
is WCF Web API the same as http://blogs.msdn.com/b/endpoint/archive/2010/01/06/introducing-wcf-webhttp-services-in-net-4.aspx?
Apr 27, 2011 at 7:52 PM
Edited Apr 27, 2011 at 7:55 PM

This is a good question. It's 1 year old, but I'd like to to know the relationship.

I'd also like to know the relationship between This API and the WCF API.  For example 

ServiceHost
   --> HttpServiceHost From the WCF Web API
         --> HttpConfigurableServiceHost
   --> WebServiceHost from System.ServiceModel.Web

So either way we are using a ServiceHost. What makes WebServiceHost run in the WCF Context while HttpServiceHost does not, or does it?
Apr 27, 2011 at 8:57 PM

I think the purpose of the WCF Web project is to make it possible to deploy WCF-based web services without all the ceremony that is normally required for WCF. IOW, it's WCF, but there's a layer on top of it to make it run without a lot of the configuration headache.

Coordinator
Apr 27, 2011 at 11:30 PM

Completely different animals

Our new hosts use a new custom binding called HttpBinding. HttpBinding replumbs WCF top to bottom specifically for HTTP. It introduces HTTP specific extensibility points as well as a new HTTP programming model with support for custom formatters and with support for accesing raw HTTP at the highest levels in the programming model through our HTTP messages. WCF Web API fundamentally changes the core message which travels through WCF to be only for HTTP. All of this is to deliver a 100% optimized experience for exposing applications over HTTP.

WebServiceHost uses the WebHttpBinding. That binding uses the traditional WCF model which is agnostic to any specific transport. It does not offer the richness and fidelity of the new model. It does allow you to / is more ideal for cases where you want to expose a service over multiple transports including SOAP. The goal with WebServiceHost was to support the existing WCF idioms / abstractons while allowing more control over HTTP. It is very limited in comparison to the new model.

Hope this helps

Glenn

Apr 28, 2011 at 12:20 AM

Thanks for the explanation.