advantages of asp.net webapi over wcfhttp://forums.asp.net/t/1799346.aspx/1?advantages+of+asp+net+webapi+over+wcfMon, 07 May 2012 06:48:51 -040017993464962243http://forums.asp.net/p/1799346/4962243.aspx/1?advantages+of+asp+net+webapi+over+wcfadvantages of asp.net webapi over wcf <p>Hi,</p> <p>please let me know the advantages of asp.net web api over wcf.</p> 2012-05-02T15:27:59-04:004962260http://forums.asp.net/p/1799346/4962260.aspx/1?Re+advantages+of+asp+net+webapi+over+wcfRe: advantages of asp.net webapi over wcf <ol> <li>Full control over how you send and respond to HTTP protocol messages </li><li>A simplified abstraction; the simplest Web API you can build can wrap an HttpMessageHandler, which is more or less a simple funciton taking an HttpRequestMessage and returning a Task&lt;HttpResponseMessage&gt; </li></ol> <p>Those are the big wins for me. If you really want to just serialize objects and deserialize the same strongly-typed objects on the other side of the wire, or if you want to use SOAP, you would be better off sticking with WCF. In those cases, you really don't care about the protocol.</p> 2012-05-02T15:40:24-04:004962316http://forums.asp.net/p/1799346/4962316.aspx/1?Re+advantages+of+asp+net+webapi+over+wcfRe: advantages of asp.net webapi over wcf <p>WCF is an RPC framework (and to my knowledge it is the best one) enabling you to pass parameters to call methods on a server and return the result as if the code ran locally.</p> <p>Web API is based on REST guidelines (best implemented in HTTP) allowing you to embrace HTTP's full goodness such as client-server architecture, web caching, resources, hypermedia, etc. It allows the same API to be called by <strong>wide variety of clients</strong> including smarphones.</p> <p>If all you care is RPC, then WCF is fine but for a new world API serving all kind of devices Web API is superior. More info here (section of comparing WCF and REST):</p> <p><a href="http://byterot.blogspot.co.uk/2012/03/aspnet-web-api-series-part-0-why-not.html">http://byterot.blogspot.co.uk/2012/03/aspnet-web-api-series-part-0-why-not.html</a></p> <p></p> <p></p> <p></p> 2012-05-02T16:08:05-04:004962327http://forums.asp.net/p/1799346/4962327.aspx/1?Re+advantages+of+asp+net+webapi+over+wcfRe: advantages of asp.net webapi over wcf <p></p> <blockquote><span class="icon-blockquote"></span> <h4>aliostad</h4> <p></p> <p>Web API is based on REST guidelines (best implemented in HTTP) allowing you to embrace HTTP's full goodness such as client-server architecture, web caching, resources, hypermedia, etc. It allows the same API to be called by <strong>wide variety of clients</strong> including smarphones.</p> <p></p> </blockquote> <p></p> <p>Web API is in fact not based on REST. The goals of the project have always been aligned with giving first-class access to the HTTP protocol. You can certainly implement all the constraints defined in REST using Web API, but that's not the baseline. Your point about RPC is valid, as Web API will not do as much for you wrt RPC use of HTTP.</p> <p>I found <a href="http://www.subbu.org/blog/2012/04/protocols-vs-styles">this blog post</a> useful in understanding the difference in protocol versus style.</p> 2012-05-02T16:13:28-04:004962340http://forums.asp.net/p/1799346/4962340.aspx/1?Re+advantages+of+asp+net+webapi+over+wcfRe: advantages of asp.net webapi over wcf <p>That is always a controversial topic isnt it?!</p> <p>What I meant was <em>Web API ambraces HTTP which in turn is a good implementation of REST.</em></p> <p>So Web API itself does not prescribe REST but if you use all HTTP features exposed within Web API, then you are doing REST.</p> <p>I suppose this is more technically correct.</p> <p></p> 2012-05-02T16:26:37-04:004968371http://forums.asp.net/p/1799346/4968371.aspx/1?Re+advantages+of+asp+net+webapi+over+wcfRe: advantages of asp.net webapi over wcf <p>There are many advantages of asp.net web api over wcf. For detail advantages of that, you can refer link below:</p> <p><a href="http://wcf.codeplex.com/wikipage?title=WCF%20HTTP&amp;utm_source=twitterfeed&amp;utm_medium=twitter">http://wcf.codeplex.com/wikipage?title=WCF%20HTTP&amp;utm_source=twitterfeed&amp;utm_medium=twitter</a></p> 2012-05-07T06:48:51-04:00