Web API is a subset of feature offered by Odata Protocol and easy to build
ASP.Net web AP
WCF Data Service
1. Use this when you want to build a application that will be driven by URL such as MVC based UI application
2. This is used to build an web application that confirms to REST but not targets to OData protocol but confirms to subset of protocol
1. Theses are pure backed services and usually consumed by some UI application.
2. Fundamental use of Data Service is to expose plain data base tables and relation between the tables as XML response stream so that large amount of data can be transferred across heterogeneous consumers
- WCF Data Services requires something like a DataContext. Web API doesn't.
- Web API is a way to add a pure http API to your application. It can be hosted in MVC, webforms, in a console app etc.
- It's much simpler to implement an http API with Web API (very similar to MVC controllers with routing being similar).
- If you expose an IQueryable, you get basic ODATA support (like filtering, ordering etc.)
- In other words I would say that both data service and WebAPI both confirms to REST but data service also confirms to OData(That is further extention of REST ), while WebAPI do not even target it