What's the difference between WCF Web API and ASP.NET Web API

Not loved picture Not loved · Feb 26, 2012 · Viewed 34k times · Source

I've done a bit of work in the past using WCF WebAPI and really liked a lot of its features, I'm just playing with ASP.NET Web API at the moment and it seems completely different (IE completely removed from WCF).

Does anyone know which features of WCF WebAPI are included in ASP.NET 4 Web API?

Answer

Not loved picture Not loved · Feb 26, 2012

Ive done a little more reading around this and found a few pages by MS people on this:

http://wcf.codeplex.com/wikipage?title=How%20to%20Migrate%20from%20WCF%20Web%20API%20to%20ASP.NET%20Web%20API :

The WCF Web API abstractions map to ASP.NET Web API roughly as follows

WCF Web API -> ASP.NET Web API

  • Service -> Web API controller
  • Operation -> Action
  • Service contract -> Not applicable
  • Endpoint -> Not applicable
  • URI templates -> ASP.NET Routing
  • Message handlers -> Same
  • Formatters -> Same
  • Operation handlers -> Filters, model binders

and http://wcf.codeplex.com/discussions/319671

The integrated stack supports the following features:

  • Modern HTTP programming model
  • Full support for ASP.NET Routing
  • Content negotiation and custom formatters
  • Model binding and validation
  • Filters
  • Query composition
  • Easy to unit test
  • Improved Inversion of Control (IoC) via DependencyResolver
  • Code-based configuration
  • Self-host