At the end you will know the result for who is the winner and who is the loser. So, let's starts the race.
As you know their are lots of technologies available that allow you to create services which can be consumed by different client, the client can be web application, window application, mobile application, etc. Services can be http enabled or support multiple protocols.
As you know today we will discuss only about the WCF and Web API.
WCF stands for Windows Communication Foundation, created by Microsoft with .NET Framework 3.0. It provides us a platform where we can build secure, reliable service that can integrate across the platforms and interoperate smoothly.
Web API is also a framework that is used to make HTTP services. As you know, now a days we are using mobiles, tablets, apps and different types of services, so Web API is a simple and reliable platform to create HTTP enabled services that can reach wide range of clients. It is used to create complete REST services.

So, let's start the race between Web API and WCF and see at the last that who is the winner.
SOAP
Simple Object Access Protocol [SOAP] is a protocol invented by Microsoft that is used to create a structured format data or message that can transfer over the internet. SOAP protocol is the main foundation of WCF and uses XML format. Web Service creates WSDL [Web Services Description Language] file which provides the information about the service data, so WSDL file is used by the client to understand the methods available on the service.
REST
REST stands for Representational State Transfer. It is not a protocol like SOAP whether it is architecture design pattern that is used for building and creating Web Services.
Web API used this pattern to build web services. Basically Web API is a resource driven architecture that exposes endpoint to the client. Web API is fully REST supported. It uses GET, PUT, POST, DELETE verbs to communicate with the clients.
Interoperability
RESTful services like Web API are simple and light weight and easy to access by any client which supports HTTP calls. It is not like to SOAP where client need to understand WSDL to implement the service.
WSDL uses some extra configuration and require some additional logic that might not be available on many devices such as phones, smart TVs, Tablets, etc.
As WCF supports many protocol so it can consumed by lots of client that are using different protocol such as TCP, MSMQ, etc. not only HTTP protocol to access service.

Configuration Overhead
Client needs to make more configurations as compared to Web API to access WCF Service. WCF uses more configurations such as endpoints, behaviors, etc to expose the service. But Web API has more standard way to customize the service which helps it to reach more clients.
Speed
As RESTful services use HTTP protocol to access client and HTTP request/response are smaller than a SOAP request, so Web API is the best choice if you are going to create a service for low bandwidth devices or mobile devices to access client. HTTP request/response is also more readable as compared to SOAP because it contains header, body, etc. which makes it complex.
Security
WCF service provides us high level security framework which provide enterprise level security. It uses WS-I standard to provide secure service.
But Web API uses web standard security such as basic authentication, token authentication and for more complex such as OAuth; Web API provides more flexibility. Then use SOAP when you are going to authenticate with external services such as google, facebook, etc.

Winner?
So, finally to see the above point, we cannot decide which is better than the other. But I want to focus on the two points. Firstly, if you are going to create a service which would be used on different platforms, then go with WCF. Secondly, if you are creating internet service which is going to use external resource, then go with Web API.
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

arvind baldaniyaPosted May 25, 2017, 2:42 AM
which batter web api or wcf and which secure
Sakti MohapatraPosted Jan 6, 2017, 12:37 PM
Hi, New to WEB API. Just trying to understand, Is that REST ful services can be implemented by using WEB API? Is this statement correct? Thanks and regards
Benjamin DroletPosted Dec 5, 2016, 2:25 PM
Another interesting point to discuss, would be configuration and setup. I have seen organizations use WebAPI simply because it is easier to config and start using. I would argue that WCF allows for more flexibility though.
Vikram ChaudharyPosted Oct 4, 2016, 8:14 AM
In WCF also we can create REST based service using WebHttpBinding. and this binding we can use for various devices. Can you please tell how is it different from Web API.
kollu nageshPosted Aug 10, 2016, 1:57 PM
Nice
Vivek KumarPosted Aug 10, 2016, 8:52 AM
Nice one
Tk MahantaPosted Aug 10, 2016, 8:19 AM
Very nice Articles...I Like It
Akash MalhotraPosted Dec 4, 2015, 10:05 AM
Nice article
satya satyaPosted Dec 4, 2015, 4:39 AM
nice
Mukesh KumarPosted Nov 26, 2015, 5:31 AM
Thanks to all for your valuable comments
Upendra Pratap ShahiPosted Nov 26, 2015, 4:49 AM
nice..
Vipul MalhotraPosted Nov 6, 2015, 8:28 AM
nice article
Lalit RaghavPosted Nov 5, 2015, 1:10 PM
nice article
Humayun Kabir MamunPosted Nov 4, 2015, 11:32 PM
Nice..
Ranjan DailataPosted Nov 4, 2015, 2:50 PM
You can achieve interoperability either by using WCF or Web API. One can literally consume the service on any platform. WCF or Web API REST based services are designed to be consumed by variety of clients like Mobile, Desktops. The good thing about Web API is, it supports default JSON/XML. However it is limited to HTTP protocol only. Whereas WCF has a great flexibility and security options. Also the protocol support are much wider ex- HTTP, TCP, UDP, and custom transports. If you are planning to write a service and host on any protocol, then WCF is the candidate. So both are winners :)
Anu VPosted Nov 2, 2015, 4:53 AM
good one..
Mukesh KumarPosted Oct 27, 2015, 3:02 PM
Thanks to everyone. . Today this article selected for Article of the day by Microsoft Asp.Net community http://www.asp.net/community/articles
Santhakumar MunuswamyPosted Oct 18, 2015, 4:01 AM
Good one
Mukesh KumarPosted Oct 16, 2015, 5:48 AM
Thanks Yudi
Yaduveer SainiPosted Oct 16, 2015, 5:36 AM
Good Job Sir
Banketeshvar NarayanPosted Oct 16, 2015, 3:33 AM
Great job.. Keep it up!
Mukesh KumarPosted Oct 15, 2015, 12:30 PM
Thanks Gowtham
Gowtham KPosted Oct 15, 2015, 11:43 AM
Good One Thanks for sharing :)
Mahesh ChandPosted Oct 10, 2015, 3:36 PM
Good article and points. Both have its own pros and cons. WCF has a wider range and also provides machine-to-machine communication. Web API is designed to server modern Web and mobile platforms. We use both of them in our projects and products. Most of our mobile apps that serve backend data are now migrating to Web API. Cheers!
Mukesh KumarPosted Oct 10, 2015, 4:09 AM
Thanks sir... here both have their own benefits
Afzaal Ahmad ZeeshanPosted Oct 10, 2015, 3:50 AM
Yes, but almost each and every device now a days has a web browser. And that makes ASP.NET much better than WCF, even if WCF has more protocols handled. :-) Even the WCF would need internet, so which leaves us again to Internet-based service (unless you are going to use a local network based service, like a service for your office or home). So, in my humble opinion, I will say ASP.NET Web API is a go. WCF has other many things that you should consider taking care of, like managing the client, license, and other things.
Harshad PansuriyaPosted Oct 10, 2015, 2:18 AM
Nice one
Nilesh JadavPosted Oct 10, 2015, 2:08 AM
Great work sir
RakeshPosted Oct 10, 2015, 2:07 AM
Good Article share