Saturday, February 18, 2012

First MVC and now Web Api Microsoft is on a roll

The newly release Web Api is the next version of the excellent WCF Web API.

ASP.NET Web API is a framework for building and consuming HTTP services that can reach a broad range of clients including browsers and mobile devices. It’s also a great platform for building RESTful services. ASP.NET Web API takes the best features from WCF Web API and merges them with the best features from MVC.

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


More information can be found at Web Api. the official Microsoft Web Api web site.

Over the past 11 years I've used asmx web services, ashx handlers and WCF services to build consumable web services. Recently I've ditched WCF as being too cumbersome and configuration heavy to use MVC as a poor man's Web service provider. Using Action Filters to create XML and JSON outputs dependent on the client request it made developing web service endpoints so much easier.

Now with the new Web Api solution from Microsoft all the MVC goodness (routes etc) and the good bits from WCF Web Api seems to have given a solid Web Services base to build robust .Net Apis with ease.

Initial set up is relatively easy either via NuGet or the ASP MVC 4 beta release installer

I'll endeavour to get a sample up very soon, hopefully as part of my Knockout js series.

In the meantime go to the Web Api home page or have a look at Jon Galloway's blog, ASP.NET MVC 4 Beta Released!, which contains an informative section on the ASP.NET Web API.

No comments:

Post a Comment