Rest – WCF Data Services (OData) Vs ASP.NET Web API? Hypermedia

asp.net-mvc-4rest

I'm desiging a distributed application that will consist of REST services and a variety of clients (Silverlight, iOS, Windows Phone 7, etc). I was ready to decide that I would implement my REST services using WCF Data Services (OData) but now the the MVC 4 Web API has made me question that decision.

What I liked about OData was the URI querying and hypermedia capabilities you get for free. What I disliked was the verbosity of the OData payload; lots of unnecessary characters coming over the wire.

What I like about the Web API is that the payloads are much more concise and it has the URI querying capability of OData, however it seems to be lacking hypermedia (out of the box, at least). My boss is also pushing for the Web API because "the powers that be at Microsoft are backing it and OData hasn't been getting traction."

So I have two questions:

1) Can anyone comment on the backing/traction of the Web API and OData?

2) Is the Web API expected to natively support hypermedia by release time or are there any off-the-shelf implementations or examples I should look into?

Thanks!

Best Answer

Web API does odata. See Scott Guthrie's blog post. Specifically:

Query composition: Web API enables you to easily support querying via the OData URL conventions. When you return a type of IQueryable from your Web API, the framework will automatically provide OData query support over it – making it easy to implement paging and sorting.

I'd also think that in many cases the same class could be the traditional WCF class and the Web API class, they are definitely not mutually exclusive.