In this tutorial, you will learn

What is WCF? What is Web API?
Why use WCF?
Why used Web API?
Characteristics of WCF
Characteristics of Web API
WCF Vs Web Service
The deciding factor for WCF vs. Web API

What is Web API?

ASP.NET Web API is a framework which allows you to build HTTP services for browsers and mobile devices. It is an ideal platform for developing RESTful applications on the ASP .NET Framework. The ASP.NET Web API is an extensible framework for building HTTP based services that can be accessed in different applications on different platforms such a web, windows, mobile devices, etc.

Why use WCF?

Here, are pros/benefits of using WCF:

WCF is an ideal option if you are planning to use .NET Framework 3.5. WCF support multiple protocols such as HTTP, TCP, Named pipe. WCF service is useful if you want to build service with standards like Transactions Messaging security and Reliable Message Security. You can use Request-Reply, One Way, and Duplex message exchange patterns with WCF.

Why used Web API?

Here, are pros/benefits of using web API:

Web API provides supports for convention-based CRUD Actions since it works with HTTP verbs ( GET, PUT, POST, and DELETE) It is easy to define, expose, and consume in a REST-ful way. ASP.Net Web API allows you to showcase your data and services to various devices. Web API is open source, so it is an ideal option for creating RESTful services over the .NET platform. Allows you scalable, decoupled development of a Web Service which can be shared and used by other developers to access web services. It is also helpful to build simple, non-SOAP-based HTTP Services.

Characteristics of WCF

Highly configurable transports Better options for serialization Well-integrated with IIS Easy for self-hosting Very rich metadata Complex model for publication Rich data contracts

Characteristics of Web API

Tightly coupled to HTTP Easy to test Offers support for content negotiation Allows open-ended formatting No reliance on a platform Solid resource-orientation Level 2 experience with nascent hypermedia support

WCF Vs Web Service

The deciding factor for WCF vs. Web API

Following is a quick checklist to help to determine whether to use WCF or Web API