Introduction
Service technology is a new trend in the World Wide Web, where Microsoft provides the modularity to use and easy to make the service with the .NET framework. Some years ago, when we were using the service with XML as a web Service (.ASMX) in 2002 and then Microsoft added the broadly capable Windows Communication Foundation (WCF) a few years later.
Microsoft gave .NET developers many options for building SOAP-Based services. With some basic configuration changes, we could support a wide array of communication protocols, authentication schema, message format, as the WCF standard. In short, now a days the demand for mobile-to--service communication and browser-based, single-page applications have evolved in the market rapidly. It was no longer enterprise services talking SOAP/RPC to each other. These application needed a simple HTTP-only, JSON-compitable back end. The internet needs of these applications look like a connected version, REST.
The ASP.NET Web API is a powerful framework for building HTTP-only, JSON-by-default web service without all the fuss (no setting of endpoints, neither setting of contracts) of WCF. Model binding works out-of-the-box and returns the plain-old CLR Objects. From these frameworks we can make RESTful services in a few minutes.
Advantages of Web API
- Configuration
WCF has endpoints and contracts. There are no settings for those things in the Web API.
- Rest by Default
URL Routing features provided by the framework are unlike a WCF where a service is an address to a physical file. (In other words, an address that maps directly to a services class or .SVC file.) A service address with the Web API is a restful route that maps to a controller method.
- Simpler Extensible Processing Pipeline
The Web API provides a highly-extensible and much simpler processing pipeline. For example, delegating handlers and filters are mechanisms providing pre-processing and post-processing capabilities.
Handlers allow us to execute custom code prior to any controller being activated within the application. In fact, handlers can be configured to handle routes that have no corresponding controller.
Filters are very useful classes that contain a few methods allowing to run some code before and after specific controller methods are invoked. These are action filters, authorization filters and exception filters. These filters take the form of attributes and they are either decorated on specific controller methods, decorated on the controllers themselves or configured globally for all methods.
- Abstraction with Routes
Routes provide the Web API service developer a layer of abstraction between what the users see and the underlying implementation. We can map any URL to any controller method. When the API signature (in other words, the REST URL) isn't hard-wired to a specific interface, class, or .svc file, we are free to update our implementation of that API method, as long as the URL specification for that method remains valid.


Arweb AroshanzamirPosted Feb 9, 2015, 3:44 PM
nice one.. thanks sir
Arweb AroshanzamirPosted Jan 16, 2015, 5:40 AM
good job Rajeev Ranjan
Kalyani BharadPosted Dec 8, 2014, 7:35 AM
Thanks for the knowledge its very much helpfull to me