Saturday, December 14, 2013

ASP.NET Web API vs WCF

With Microsoft.NET Stack there are lots of way to create service like ASP.NET Web Service, WCF(Windows Communication Foundation) service and now ASP.NET Web API. The developer often get confused mainly between WCF Service and Web API. So I thought it is a good idea to write a blog post to about differences between ASP.NET Web API and WCF Service.

Difference between ASP.NET Web API  and WCF Service:


  1. WCF services support multiple transport support like HTTP,TCP,UDP,MSMQ and allow switching between them while ASP.NET Web API is used only http based services best suited for http service and mobile based application back end service. It is an quick and easy way to create http service.
  2. WCF support multiple encodings like Text,MTOM while ASP.NET Web API support wide range of media types like XML,JSON etc.
  3. WCF Service support Request-Reply, One way and duplex exchange patterns while HTTP service only support Request/Return pattern.

When to choose? What? WCF or Web API


  • Choose WCF if you want to support any other transport protocol then HTTP.
  • Choose Web API when you want to create resource oriented services very quickly.
  • Choose Web API when you want to serve wide variety of clients like browsers, mobile etc.
  • Choose WCF when you want to support message queuing, one way messaging and duplicate message communication.
Share:

2 comments:

Your feedback is very important to me. Please provide your feedback via putting comments.

Search This Blog
Loading...
About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews