We all are know that WCF is best for Service oriented programming and it supports high level protocols, security. This article explains the when should we use Web API instead of WCF service.

Getting Started

Before starting how to work with Web API, I would like to describe the situations that will helps developer to choose Web API for service oriented application. There are many cases that will force developer to use Web API instead of WCF service.

First Case, ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. It means in practically developers should use Web API when let’s say there is a function that contains some business logic and data process, that function is used by both web client and mobile client.

When your service oriented programming does not required high level protocol rather than only HTTP protocol, because Web API supports only HTTP protocol and application requires only limited media types like TEXT, JSON, XML etc.

ASP.NET Web API should be used, if you are creating and designing new REST-style services. Although WCF provides some support for writing REST-style services, the support for REST in ASP.NET Web API is more complete and all future REST feature improvements will be made in ASP.NET Web API.

When you want to create a resource-oriented services over HTTP that can use the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formatsand when you want to expose your service to a broad range of clients including browsers, mobiles, iphone and tablets.

Use ASP.NET Web API when high level security like Message Security and multiple message pattern does not required, because HTTP is request/response but additional patterns can be supported through SignalR and WebSockets integration.


In this article we have discussed the situations to use ASP.ENT Web API, The next part of the article I am going to demonstrates how to create Web API. Hope this artcile may helpful to you.

Kailash Chandra Behera

No comments:

Post a Comment