Q&A: I want to develop a Web API. Should I choose WCF with REST or ASP.NET Web API?
Posted: (EET/GMT+2)
It is time to cover a new question from the field: should I choose between WCF (Windows Communication Foundation) or ASP.NET Web API when I need to implemented and REST style web API solution?
Firstly, you need to think about the needs of your service. Do you need to support proper Web Services, i.e. the SOAP protocol (Simple Object Access Protocol), and/or other protocols than just HTTP? If your answer is yes to either of these questions, then you must choose WCF, as it supports both SOAP and non-HTTP requests. However, if your API can be HTTP-only (or HTTPS, of course), and you don't need SOAP, then you can choose Web API, too.
MSDN contains a nice comparison of these features, and I do not need to repeat the points covered there. However, I would like to add two points of view: development and maintenance simplicity, and the path to the future.
On both counts, I believe ASP.NET Web API is a winner. Application development is simpler and cleaner, and also ASP.NET is under active development. WCF is great, and the best solution for SOAP based, reliable and "enterprise-grade" messaging (think security, transactions, etc.), but ASP.NET Web API is more lean and clean.