Mads Kristensen is a Program Manager at Microsoft and during his Tech Days 2012 talk on “What’s new in ASP.NET 4.5 + Visual Studio 11” he made a statement that “Web API is, kind of, the new WCF” – it’s about an hour in if you want the exact spot. Putting the “kind of” part to the side for the moment, this is something of interest as two key questions I ask myself, out of many that I consider when designing a new Microsoft solution, are (1) have I identified the right technologies, i.e. MVC, SQL, Azure, etc. and (2) what type of commitment is Microsoft making to the technologies I’ve chosen. I am lucky to be managing several Azure solutions, some of which I’m reworking with regards to how I expose services over HTTP, and I find it very reassuring to know where Microsoft are heading on this particular topic and I’m not going to make a decision that I regret in the medium-term because I picked the wrong framework.
Related to this, on the matter of technology choices, approximately 90% of developers are still building Web Form solutions. Microsoft know this but they’re banking on MVC, pushing it out to developers and architects wherever possible. So, by the same token as the ASP.NET Web API choice regarding HTTP services, if I’m starting a new solution I’m definitely going to think seriously about choosing MVC over Web Forms, or in this case ASP.NET Web API over WCF.
A few days after Mads announcment Scott Gu posted a blog titled “ASP.NET Web API (Part 1)“, followed a few days after by Scott Hanselman’s blog on “One ASP.NET – Making JSON Web APIs with ASP.NET MVC 4 Beta and ASP.NET Web API“. Both of these add further support to Mads point and do a great job of clarifying that point further in this posts. I’ve taken the following image from Scott Hanselman’s blog post (previously noted) as I think it clearly illustrates a number of points made above.
(Diagram taken from Scott Hanselman’s blog)
ASP.NET Web API Features
These features are taken from a post on the WCF CodePlex website, they give you an idea of how broad the ASP.NET Web API feature set is:
- Modern HTTP programming model
- Full support for ASP.NET Routing
- Content negotiation and custom formatters
- Model binding and validation
- Query composition
- Easy to unit test
- Improved Inversion of Control (IoC) via DependencyResolver
- Code-based configuration
ASP.NET Team Merged with WCF Team
Officially, in the Microsoft camp, you’ll see Web API referred to as ASP.NET Web API. This is because they’ve merged the ASP.NET team with the WCF team. In addition to this the ASP.NET Web API has shipped with the ASP.NET MVC 4 Beta. Microsoft want an integrated web API framework which is music to my ears.
This article really only scratches the surface of what Web API is all about. There is a lot more reading to be done if you’re really interested to know more, or get knee deep in the coding side of it.
Hopefully those reading this post will find it of some benefit when considering how they’ll be addressing future HTTP-based services requirements.
- .Net Slave – Mads Kristensen’s Blog
- Computer Zen – Scott Hanselman’s Blog
- Scott Gu’s Blog
- WCF Web API Overview – CodePlex
- ASP.NET Web API released with ASP.NET MVC 4 Beta! – CodePlex