WCF Data Services 5.0 RTM Release


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

Vocabularies

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

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.

Spatial

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).

ODataLib:

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.

EdmLib

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.

Any/All

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.

Collections

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.

Named Streams

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.

 

Turker Keskinpala

Program Manager

WCF Data Services/OData Team


Comments (25)

  1. DotNetWise says:

    Wow, I was waiting for this release since October 2011!!

    Keep up the good work!

    How is it related with EF 4.2 june 2011 CTP and/or EF 5.0 beta? They both have enum support, but October 2011 CTP WCFds still didn't have.

    When I first read about vocabularies, I thought, hey – there's a way of implementing enums support!

    "Simple vocabulary terms can do things like indicate a property’s acceptable value range"

    That's what enums are all about – acceptable value range!

    So how do WCFds stand about enums?

    http://www.dotnetwise.com

  2. application/json doesn't work anymore says:

    When I request the service with the application/json accept header, I get the following error!

    <error xmlns="schemas.microsoft.com/…/metadata">

    <code/>

    <message xml:lang="en-US">Unsupported media type requested.</message>

    </error>

    What happened?

  3. DotNetWise says:

    application/json is not a valid mime-type anymore!

    application/json;odata=verbose is valid.

    You can simply replace it on your server on the InitializeService method or fork Wcf Data Services Toolkit and change:                     httpmsg.Headers["Accept"] = "application/json"; to

                       httpmsg.Headers["Accept"] = "application/json;odata=verbose";

    in JsonInspector.cs line about 40

    http://www.dotnetwise.com

  4. Piquet says:

    OK – I'll bite – can I use actions when I'm using EntityFramework?  Any doco on how to do this?

  5. B says:

    Silverlight 4? what's about Silverlight 5?

  6. Rui Marinho says:

    How can we query via url the multivalue fields…i get a error whe  using "any" …

  7. Anshuman says:

    Does new version start supporting join and other stuff along with any and All.

  8. Matt Meehan [MSFT] says:

    Regarding the change to 'application/json':

    Included in V3 of the OData protocol is a new more efficient JSON format which will be the primary JSON format going forward (the format itself has been described in part on OData.org and on the mailing list). In order to support this, V3 requests for 'application/json' will result in a 415 status code on the 5.0 RTM release. You can work around this by either specifying 'application/json;odata=verbose' as mentioned above, or by including a 'MaxDataServiceVersion' header value less than 3 (its generally a good practice to include this header whenever possible). The team is currently working on implementing the new format and will provide an updated version of WCF Data Services and the standalone OData library when it is complete.

    Some relevant links:

    http://www.odata.org/…/an-efficient-format-for-odata

    http://www.odata.org/…/format-efficiency-take-2-really-clean-json

    mailinglist.odata.org/…/wa-ODATA.exe

    mailinglist.odata.org/…/wa-ODATA.exe

    Regarding other comments:

    1) No support for join yet

    2) Actions on EF are supported if you have an implementation of IDataServiceActionProvider. I suspect Alex James will be posting something more about this very soon (either on this blog or his).

    3) If you're having problems using any of the new features, please head over to the msdn forums so that its easier to have a back-and-forth discussion: social.msdn.microsoft.com/…/threads

  9. Alex James says:

    @Piquet

    Checkout the latest blog post – the start of a 3 part series on Actions. 🙂

  10. dpblogs says:

    @Rui

    Try something like this: ~/Service/Movies?$filter=Tags/any(t: t eq 'Cool')

    where Tags is a Collection(Edm.String).

  11. Lex Lavnikov says:

    data.svc/Classes$expand=Children

    where Children is many-to-many relation is broken in RTM, October CTP worked just fine 🙁

  12. Hi Lex,

    Could you head over to the MSDN forum and create a thread about the $expand issue you're having? If you could provide the actual error message, it would help us diagnose the issue.

    social.msdn.microsoft.com/…/threads

  13. BotHead says:

    Hi,

    As soon as I updated to this version I could no longer get IgnoreProperties to work with this simple test…

       [System.Data.Services.IgnoreProperties("State")]

       public class Tmp

       {

           public Guid ID { get; set; }

           public int Test1 { get; set; }

           public TestStateEnum State { get; set; }

       }

    Followed by the typical error you would expect the ignore attribute to resolve.

    The server encountered an error processing the request. The exception message is 'The property 'State' on type 'Symbotic.DataToaster.DomainModel.Tmp' is not a valid property. Make sure that the type of the property is a public type and a supported primitive type or a entity type with a valid key or a complex type.'. See server logs for more details. The exception stack trace is:

    at System.Data.Services.Providers.ReflectionServiceProvider.BuildTypeProperties(ResourceType parentResourceType, IDictionary`2 knownTypes, IDictionary`2 childTypes, Queue`1 unvisitedTypes, IEnumerable`1 entitySets) at System.Data.Services.Providers.ReflectionServiceProvider.PopulateMetadataForTypes(IDictionary`2 knownTypes, IDictionary`2 childTypes, Queue`1 unvisitedTypes, IEnumerable`1 entitySets) at System.Data.Services.Providers.ReflectionServiceProvider.PopulateMetadata(IDictionary`2 knownTypes, IDictionary`2 childTypes, IDictionary`2 entitySets) at …

    Any idea what happened in this release?

    Thanks!

  14. BotHead says:

    I posted my previous question to the data services forum here:

    social.msdn.microsoft.com/…/ffeee9e2-b96c-4b16-8ab6-d48de066f5b7

  15. Many-to-Many tables says:

    I don't see any ways I can add a QueryInterceptor to many-to-many tables on WCFds 5.0 over EF 4.3/5.0

    since the mtm table doesn't seem to be an entity set

    [QueryInterceptor("UserBankAccounts")]

    Weird enough adding a non existing entity set will break the service at all, without any error message

    Chrome says This webpage is not available

    while IE says Internet Explorer cannot display the webpage

    This should been fixed to show a nice error message especially when [ServiceBehavior(IncludeExceptionDetailInFaults = true)]

    and even

    public static void InitializeService(DataServiceConfiguration config)

    {

    config.UseVerboseErrors = true;

    I kind of hate it you just jumped from lots of CTP directly to RTM with no beta/RC in between!

    Last October 2011 CTP seemed to be even more stable than the current RTM

    See @Lex Lavnikov's message above!

  16. 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.

  17. crankage says:

    Whats the difference between WCF Data Services and the new Web API stuff supported by MVC4?

  18. Mathieu DSTP - CBCSRC says:

    Has it become any easier to implement NHibernate as a DataService Provider?

  19. @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?

  20. Jerusalem Hotel says:

    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

  21. 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.

    Regards

    Toby

  22. fastlink30 says:

    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.

  23. Andrew says:

    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?

  24. Johan says:

    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.

  25. Is there Visual Studio 2012 support? The installer only mentions 2010.