WCF vs WebAPI

WCF is a best fit for scenarios like message queues, duplex communication, end-to-end message security, one way messaging, distributed transactions, etc.

WEB API is a best fit to create a resource-oriented services using HTTP/Restful and it works well with MVC-based applications. Supports controllers, routing, filter, action results, IOC container, model binders, or dependency injection, and unit testing that simplifies it and makes it more robust.

WCF was created to develop SOAP-based services and bindings. Since WCF is SOAP based, which uses standard XML schema over HTTP, it could lead to slower performance.

WEB API is a better choice for simpler, light weight services. WEB API can use any text format including XML and is faster than WCF. WEB API can be used to create full-blown REST Services.

it uses the complete features of HTTP (such as response/request headers, URIs, caching, versioning, and numerous content formats).

Requires configuration setup on server and client both.

WEB API doesn’t require any data contracts and doesn’t require configurations to the level of WCF.

How to Choose Between WCF vs Web API

Select WCF when you want to produce a service that would benefit specific situations like one-way messaging, message queues, duplex communication, message queues, etc.

Select WCF when you want to produce a service that uses quick transport channels when available, such as Named Pipes, TCP, or perhaps even UDP (in WCF 5). You would also need support for HTTP when other transport channels aren’t available.

Select Web API when you want to produce resource-related services over HTTP that utilize the complete features of HTTP (such as response/request headers, URIs, versioning, caching, and numerous content formats).

Select Web API when you want to display your service to a wide variety of clients with mobiles, browsers, and tablets.