Difference between WCF and Web API
Difference between WCF and Web API
Release of the ASP.NET Web API beta: With the latest release of the ASP.NET Web API beta as portion of the ASP.NET MVC 4 beta, there are many people nervous about the placement of the ASP.NET Web API vs WCF vs old avatars of the ASP.NET Web API. There is also quite confusion around when you should employ which, and what the coming launch of Web API means for the future of WCF. I’ll try to express both of those matters here. This post will reveal the difference between WCF and Web API.
WCF vs Web API
History: First let’s have a look at history. In .NET 3.5 the WCF group integrated support for a WebHttpBinding and “WebHttp” endpoints, which they further improved slowly in WCF 4. These were a try to sudden jump on some assistance for building simple non-SOAP based HTTP service services (also known as “Web APIs”) on head of the existed WCF message pipeline. REST was initiating to get very famous in that time span and there was quite pressure being insert on Microsoft to deliver a solution for building RESTful solutions. WebHttp endpoints were their first try to deliver assistance for doing so.
Fundamental problem with WCF: There was a basic problem with that approach. The WCF stack was actually built from the scratch around SOAP messaging. When WCF employs HTTP, it is employing it just like a transport protocol, similar to how it employs Named Pipes, TCP, MSMQ or any other wire level protocol. HTTP is able to manage much insight semantics and that is what REST and Web APIs want to purchase. However trying to assemble a façade on the upper part of the WCF channel stack that represents the full capabilities of HTTP is about the similar as trying to assemble a Hollywood frontage of an old west prairie town on a latest building there is a basic resistance mismatch there.
So actually Microsoft was required a “do-over” for delivering support for Web API and REST services by constructing a stack to assist that from the scratch like they done for SOAP with WCF. They needed to show the capability to maintain really simple RPC style services with HTTP and required to be able to assist the entire range of abilities required to assist truly architectures i.e. REST-based .
True Definition of REST: The fact is that many people who claim to be performing or desire to do REST have no guess what that really means. The real definition of REST is an architectural style defined by Roy Fielding’s thesis. That style of architecture defines a number of limits. If you are not contending all of those limits you are not truly performing REST as it was actually defined. Now a lot of employ the term RESTful as a moderation to that – actually meaning REST-ish or partly satisfying the architectural limits that describe REST. Professionals on REST are driving for people to cease using the term REST unless you are thoroughly following with the architectural fashion is to be more shorten although. The things That abide by some of the REST architectural limits but not all is to refer them as “Web API” which is the alias term that many are employing for the middle ground. It is a stack for constructing Web APIs or matured REST services.
Web API makes simple to create and display a service: It is very easy to make and show a service that just displays some functionality and data over HTTP, and it is only increasingly harder to add much and much of the REST architectural limits or features to your services is possible by using the Web API. From the WCF team ASP.NET Web API began as a byproduct and there were soon public responses of what they were working over that were called WCF Web API. Wash out this term because there is no such existence any more if you have head that term. Microsoft recognized that it was perplexing for customers to have too many abilities of framework that seems to do the similar thing at first look is what happened. And there is an original fixing between the part of the framework and these Web APIs that was constructed to an HTTP pipeline from the beginning (ASP.NET).
Leave a Reply