BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

ASP.NET Web API Gets OData v4.0 Support, WCF Will Not

by Roopesh Shenoy on Mar 26, 2014 |

ASP.NET Web API 2.2 for OData v4.0 are now available as nightly builds. The team also released OData core libraries version 6.1 on nuget with several bug fixes and new features, especially increased support for OData v4 spec. However, the MS team suggested that WCF will not get OData v4 specific features.

OData v4.0 and OData JSON Format v4.0 were recently adopted as an OASIS standard. You can read what is new in OData v4.0.

Following are the improvements in both ASP.NET Web API 2.2 and the OData core libraries -

  • Protocol and format changes from V3 to V4
  • OData attribute routing
  • Support for defining functions in OData model and binding them to controller actions
  • Model aliasing - allowing different names for types or properties of OData models and CLR Types
  • Ability to define which properties of the model can be filtered, sorted, expanded or navigated across
  • Support for ETags
  • Support for Enums
  • Support for $format query string option so client can specify the format
  • Singleton support
  • Containment support

Known limitations -

  • There are many OData v4 featuers that are still not supported - the main focus of the release was feature parity with earlier release along with few new features
  • OData core libraries are capable of serializing the OData v4 Atom format but this is not officially supported since Atom specification is not at CS2 stage yet.

On the client side, there is a new package that supports only OData v4.0 - if your client needs to consume both V1-3 and V4 services, then you'll have to use both the new and the old packages in your application.

A somewhat controversial decision is to reduce investments in making WCF a stack for building OData services. This is what the OData Services team had to say -

..we do plan to reduce investment in WCF Data Services as a stack for creating OData services. To mitigate the inconvenience this may cause, we are working on cleaning up the code and making it compatible with OData v4, and will then release that stack as open source. We do not plan to put any significant investment into adding v4-specific features to the WCF DS stack.

The community, however, wants WCF to support OData 4.0. Says Adam -

As our business tier is written in WCF DS, I feel that we have been thrown under the bus on this decision. We have invested so much effort in working around the weaknesses of WCF DS (prop change tracking, performance, containment, hackish T4 support for client proxies, terrible EF6 alpha quality provider, etc) and have been happily awaiting your new v4 release only to find out at this stage that you are abandoning it. Switching to Web API at this point seems like we pay the price for every decision you make. We are a Gold MS Partner.

Others have also requested that for OData v4.0 support in WCF. We can only wait and watch whether Microsoft changes it's decision on this.

You can get started with writing an OData v4.0 service and use the OData Client Code Generator to generate client-side proxy classes.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT