1.

Explain the difference between WCF vs MVC vs ASP.NET Web API ?

Answer»

WCF 

  • It is a framework built for building or developing service-oriented applications. 
  • It is designed to exchange standard SOAP-based messages 
  • WCF can be consumed by clients which can understand XML. 
  • WCF supports a variety of transport protocols LIKEHTTP, TCP, Named Pipes or MSMQ etc. 
  • iWCF ships out with the .NET Framework.  
  • WCF service is good for Message Queue, duplex communication, one-way messaging. 

Web API 

  • Web API is an open source platform. 
  • It is a framework which helps us to build/develop HTTP services using HTTP verbs 
  • It supports most of the MVC features which keep Web API over WCF. 
  • The purpose of Web API framework is to generate HTTP services that REACH more clients by generating data in raw format, for example, plain XML or JSON string. So, ASP.NET Web API creates simple HTTP services that render raw data. 
  • This returns XML or JSON to client. 
  • All requests are mapped to ACTIONS using HTTP verbs. 
  • We cannot return a view from WebAPI 
  • In the ASP.NET Web API request is mapped to Action based on the Action Verbs. 

MVC 

  • ASP.NET MVC is used to create a web application which returns both data as well as View (HTML) whereas Web API is used to create HTTP based Services which only returns data and not view.  
  • ASP.NET MVC FACILITATES in easyrendering of HTML. 
  • MVC is used to create a web app, in which we can build web pages. 
  • JSONit will return JSONResult from action method. 
  • All requests are mapped to the respective action methods. 
  • We can return a view from MVC 
  • In an ASP.NET MVC application, requests are mapped to Action Methods. 


Discussion

No Comment Found