Introduction

This article describes the differences between the Web API and Windows Communication Foundation (WCF). And also describes how to choose between WCF and Web API.

What is the ASP. NET Web API

The ASP. NET Web API is a framework that uses the HTTP services and makes it easy to provide the response to the client request. The response depends on the request of the clients. The Web API builds the HTTP services, and handles the request using the HTTP protocols. The request may be GET, POST, DELETE, PUT. We can also say that the ASP. NET Web API:

We use the ASP. NET Web API for creating the RESTtful (Representational State Transfer) services.

The following are some important points of the ASP. NET Web API:

Architecture of Web API

arch2.jpg

What the Windows Communication Foundation (WCF) is

WCF is also a framework but it creates a service-oriented application. It can send the data asynchronously from one endpoint service to another service. The endpoint service can be the part of the continuous available service that is hosted by the IIS. There are some important points of WCF:

Architecture of WCF.

arch1.jpg

To choose between Web API and WCF:

Now define the reason of choosing the WCF: