I’m very pleased to announce the WCF Data Services 5.0 RTM release. You can download WCF Data Services 5.0 from here. This release includes several client and server features and libraries for .NET 4 and Silverlight 4.
Below is a brief breakdown of the features that are available in this release. Upcoming blog posts will dive into
By providing the ability to annotate metadata and instance data, vocabularies define a powerful extensibility point for OData. They convey meaning and extra information to enable richer client experiences. Simple vocabulary terms can do things like indicate a property’s acceptable value range. A more complex vocabulary terms could define a mapping between a particular service’s person entity and a vCard schema.
WCF Data Services 5.0 allows data service authors to use vocabularies in $metadata.
Actions in OData extend the set of operations that can be performed on or with a service or resource. Actions provide a way to inject behaviors into an otherwise data centric model without confusing the data aspects of the model. They stay true to the resource oriented underpinnings of OData. Actions may be used to extend CUD operations, invoke custom operations, etc.
WCF Data Services 5.0 allows setting up a service with Actions as well as invoking actions and service operations with full support for parameters. However, to expose Actions you need to provide or source an implementation of IDataServiceActionProvider that works with the rest of the service. Subsequent blog posts on Actions will dig deeper on this feature. Read more about our actions support here.
There has been an explosion of location-aware devices and more demand for location-aware applications. OData supports geospatial data and WCF Data Services 5.0 comes with 16 new spatial primitives and some corresponding operations. This enables data consumers to perform operations on spatial values in filter, select and orderby clauses.
Spatial primitives enable service authors to indicate, for example, that a property is a point, a line, or a polygon. These spatial primitives follow the OGC’s Simple Features standard.
Actions and Functions can be used to extend the operations associated with these primitives. This allows some servers to expose deep algorithms for powerful functionality while other services expose only basic operations. The community can develop vocabularies to describe common categories of advanced operations and indicate which ones a given service supports.
WCF Data Services 5.0 allows addition of spatial type properties to models via Reflection and Custom Service Providers. This enables read/write support in ATOM or JSON formats for all spatial types supported by SQL Server 2008 R2. Moreover, this release supports querying for all entities ordered/filtered by distance to a location (i.e. find all coffee shops near me).
The ODataLib .NET client and server libraries allow flexible low-level serialization/deserialization according to the OData Protocol Specifications. ODataLib now supports serialization and deserialization of all OData payloads.
ODataLib now ships with EdmLib, a new in-memory metadata system that makes it easy to build an Entity Data Model (EDM) of a service for OData serialization/deserialization. Moreover, EdmLib enables creation and consumption of annotations on any EDM model.
WCF Data Services 5.0 increases the expressiveness of WCF Data Services queries to be able to express queries like ‘are there any customers which have no orders’ or ‘are there any customers who only spend more than $100 at our shop’. We support the ‘any’ and ‘all’ canonical functions via the WCF Data Services client LINQ support.
Better Support for Inheritance
WCF Data Services 5.0 supports both exposing and consuming models which have properties (primitive, complex and navigation) defined on subtypes of the base type associated with the set.
WCF Data Services 5.0 adds support for properties as collections of primitive or complex types. This enables easier modeling of things like lists of alternate email addresses for a Customer.
WCF Data Services 5.0 release allows an entry to have multiple streams associated with it such that you can now create services that do things such as expose a Photo entry with links to its print, web, and thumbnail versions.
Patch Method Support
PATCH is now a standard and is semantically equivalent to the MERGE method. WCF Data Services 5.0 release supports the PATCH method as a synonym to MERGE.
Prefer Header Support
Following the semantics of the Prefer header, WCF Data Services now support returning responses to Insert and Update requests.
We look forward to hearing your thoughts on the release.
WCF Data Services/OData Team
Regarding the errors mentioned in the above post about 'Many-to-Many tables':
In general, internet browsers tend not to render the actual payload from an error response. If you want to see what is actually happening, use a web-debugger like Fiddler (http://fiddlertool.com). In general OData does not prescribe 'nice' errors that a browser can render, but rather XML or JSON representations.
Query interceptors have only ever been supported on entity sets exposed in the model.
Whats the difference between WCF Data Services and the new Web API stuff supported by MVC4?
Has it become any easier to implement NHibernate as a DataService Provider?
@crankage - WCF Data Services is an OData-only client/server framework that has support for most of the OData protocol. Web API has some OData support (e.g., $top, $orderby) as well as other types of formatters. In addition to differences in functionality, there are currently some differences in philosophy (although we are working to close those gaps). Your best bet is to try both out; if you don't need the more advanced queries OData has to offer, Web API may be the framework for you. If you do need more advanced queries and don't need other formatters, WCF DS may be the framework for you.
@Mathieu - we haven't had a lot of public asks for making NHibernate easer, but I can certainly understand why you'd want that - could you create a feature suggestion at data.uservoice.com/.../72027-wcf-data-services-feature-suggestions and start asking people to vote for it if they think it's important?
I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful
Hi, great to see v5 released, we've been using WCF DS since v1. Is there any plans on including more support for Join & GroupBy from the service. At the moment we are exposing these through views but it would add more flexibility to the service.
Also I have found a bug, not sure about the correct forum for this but if you have an Entity with a forward Slash in the Key i.e. 'ABC/123' then you can support this by implementing restricted character support and Add / Get works fine. However you can only update the entity if you use PostTunnelling = True and a none batch operation. Batch operations fail with bad request on the MoveNext function. This issues exists in v4 and v5.
how to get list of complextype on client side? i can get only 1 complextype if i try to get list/collection with (service function) of complextype an exception appear, from server side is all ok.
Better support for inheritance - Really struggling to find the documentation on how to use isof and cast with derived types, any chance of a link?
I hope the next release (and soon) will have full support for complex types. It really is a big issue not being able to map stored procedures that return a query result set (without having to do custom entities). I wish the effort would have been spent here and not with spatial data which could have come later. Seems to be a priority issue to me.
Is there Visual Studio 2012 support? The installer only mentions 2010.