I am query for a long time now.Where exactly we need to use WEB API and where should we use WCF restful services. What ever we want to achieve in WEB API we are able to achieve in WCF Rest. I tried to dig into answers but i got we need to do extra setting in wcf like URI templates,Contracts,endpoints. But its more on settings , but I wanted to known the real reason behind using WCF Restful Services.
Web Service
WCF
WCF REST
webHttpBindings
.[WebGet]
and [WebInvoke]
attributes respectively..svc
files.WebGet
needs configuration. The UriTemplate
must be specified.
Web API
MediaTypeFormatter
into JSON, XML or whatever format you want to add as a MediaTypeFormatter
.
Choosing between WCF or Web API
For more details you can refer to http://www.c-sharpcorner.com/UploadFile/8a67c0/who-is-winner-web-api-or-wcf/.