Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF vs. Web API for Windows 8 store apps

I suggested we migrate from WCF to Web API due to it being easier to implement and got shot down pretty hard. Here were the objections raised:

  • WebAPI is just made for rails converts
  • We have no need for REST or 3rd party open source support, Windows 8 Store Apps with Microsoft backend.
  • WCF over net.tcp is "MUCH" faster and less overhead than HTTP(S)+XML or JSON

The end comment was "I cannot think of a single advantage of using Web API over WCF.

Funny, my last job at a big MS tech based enterprise changed from WCF to Web API and dev productivity skyrocketed, lots of bugs disappeared and we never had any performance problems, but I don't want to just say that, I want to respond with facts to his points. How would you respond?

like image 832
Infin8Loop Avatar asked Mar 02 '26 19:03

Infin8Loop


1 Answers

WCF or ASP.NET Web APIs? My two cents on the subject:

  • If your intention is to create services that support special scenarios – one way messaging, message queues, duplex communication etc, then you’re better of picking WCF
  • If you want to create services that can use fast transport channels when available, such as TCP, Named Pipes, or maybe even UDP (in WCF 4.5), and you also want to support HTTP when all other transports are unavailable, then you’re better off with WCF and using both SOAP-based bindings and the WebHttp binding.
  • If you want to create resource-oriented services over HTTP that can use the full features of HTTP – define cache control for browsers, versioning and concurrency using ETags, pass various content types such as images, documents, HTML pages etc., use URI templates to include Task URIs in your responses, then the new Web APIs are the best choice for you.

The whole article is worth a read.

like image 72
ErnieL Avatar answered Mar 04 '26 07:03

ErnieL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!