Freigeben über


Summary: Implementing REST service implemented in (WCF and WebAPI) hosted in WorkerRole

In previous two posts I described the way how to develop and deploy WCF and WebAPI services. 

 

Bellow are my brief observations and source code attached.

 

WCF

  • More robust technology stack
  • General purpose, suitable for many different communication scenarios (SOAP, REST, binary via different transport mechanism - tcp, HTTP, queuing, etc)
  • Configurable via code as well as a configuration file
  • Long learning curve

 

WebAPI

  • Straightforward, one purpose only framework
  • Oriented to REST/HTTP only
  • Configurable only via code (code first approach)
  • Fully unit-testable, mock-able
  • Short learning curve

 

Summary

My goal was to develop REST service and it looks like WebAPI fit more to it because of the following reasons:

  1. WebAPI is more resource oriented (core idea of REST), WCF is more RPC oriented
  2. WebAPI provides better control over REST API definition in the form of routing rules
  3. Open source, 
    1. we can look "under the hood" and see what's going on there
    2. better fine tuning and maintenance
  4. Versioning: can run different controllers sidebyside
  5. Much simple to learn
  6. Code first configuration approach is very straightforward
  7. Developed with unit testing in a mind which gives the developers opportunity to write isolated functional tests with mocking legacy dependencies (file, network, etc.)

 

All in all, I'd like to use proper framework for a task I need to do.

 

Open topic: performance. That's the topic for my next post.

DemoServices.zip