WCF vs. Web API - Good to know the differences
Nowerdays the requirement for a lot of web services is to be - more or less - RESTful.
If you have a look on the Microsoft stack, you find selveral ways to implement services which can receive HTTP requests and where you can build up a service.
Here we want to compare WCF (Windows Communication Foundation) and ASP .NET Web API
What is WCF?
WCF was first released with the .NET Framework 3.0 in 2006 and then recived several improvements with .NET 3.5 and .Net 4.0
In the past, SOAP was (and still is) used for a lot for service-oriented communication. With WCF, Microsoft wanted to combine several seperate implementations spread over the .NET library.
And WCF is really that - they put the possibilities of the following technologies into WCF
- Interoperable Web Services
- Binary .Net - .Net Communication
- Distributed Transaytions
- Support for WS-* Specifications
- Queued Messaging
- RESTFul Communication
What is ASP.NET Web API?
Web API was released in August 2012, together with the .NET Framework 4.5.
As you can see, it is much newer than WCF. The goal for Web API is different from WCF. Microsoft wanted to build a lean, yet powerful framwork, focused on RESTful services.
And with this, we come to the comparison.