1

Possible Duplicate:
WCF Service or Web API

Hi guys i am developing a quiz engine application, I want to create a service that can be accessible from different client platforms e.g android, PHP, Iphone, IPad, Java e.tc. Between WCF and Asp.net web API which you think best suits the scenario? Thanks

Community
  • 1
  • 1

4 Answers4

1

These are the guidelines I usually follow:

What type of client will be using the service?

  • If you are going to access the service on the client (i.e. adding it to your project as a Service Reference), then I go with a WCF service. Letting WCF do all the work of creating the methods and classes automatically in code is much easier to use then having to do it by hand with Web API.
  • If you going to access it using AJAX and JSON, I go with Web API. Web API returns both XML and JSON by default, and with their RESTful-like URLs, it's easier to call a Web API via AJAX than calling a WCF service.
Martin
  • 11,031
  • 8
  • 50
  • 77
1

It is possible to create a WCF api application that allows returning soap, pox and json. One thing to note with returning json results is that you might have to jump out of the traditional soap security for responses.

Ross Bush
  • 14,648
  • 2
  • 32
  • 55
1

I would go for Web API without any hesitations. Reason been:

  1. Easier to setup
  2. RESTFUL nature (routings are setup for you)
  3. That's what WebAPI is created for, to replace WCF RESTFUL service implementation
Jack
  • 2,600
  • 23
  • 29
0

I would use web API because of it's REST nature, there are REST clients for basically all mobile platforms.

ryudice
  • 36,476
  • 32
  • 115
  • 163