Condividi tramite


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

  • Anonymous
    April 09, 2012
    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

  • Anonymous
    April 09, 2012
    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?

  • Anonymous
    April 09, 2012
    The comment has been removed

  • Anonymous
    April 09, 2012
    OK - I'll bite - can I use actions when I'm using EntityFramework?  Any doco on how to do this?

  • Anonymous
    April 09, 2012
    Silverlight 4? what's about Silverlight 5?

  • Anonymous
    April 09, 2012
    How can we query via url the multivalue fields...i get a error whe  using "any" ...

  • Anonymous
    April 10, 2012
    Does new version start supporting join and other stuff along with any and All.

  • Anonymous
    April 10, 2012
    The comment has been removed

  • Anonymous
    April 10, 2012
    @Piquet Checkout the latest blog post - the start of a 3 part series on Actions. :)

  • Anonymous
    April 10, 2012
    @Rui Try something like this: ~/Service/Movies?$filter=Tags/any(t: t eq 'Cool') where Tags is a Collection(Edm.String).

  • Anonymous
    April 10, 2012
    data.svc/Classes$expand=Children where Children is many-to-many relation is broken in RTM, October CTP worked just fine :(

  • Anonymous
    April 11, 2012
    The comment has been removed

  • Anonymous
    April 11, 2012
    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, IDictionary2 knownTypes, IDictionary2 childTypes, Queue1 unvisitedTypes, IEnumerable1 entitySets) at System.Data.Services.Providers.ReflectionServiceProvider.PopulateMetadataForTypes(IDictionary2 knownTypes, IDictionary2 childTypes, Queue1 unvisitedTypes, IEnumerable1 entitySets) at System.Data.Services.Providers.ReflectionServiceProvider.PopulateMetadata(IDictionary2 knownTypes, IDictionary2 childTypes, IDictionary`2 entitySets) at ... Any idea what happened in this release? Thanks!

  • Anonymous
    April 11, 2012
    I posted my previous question to the data services forum here: social.msdn.microsoft.com/.../ffeee9e2-b96c-4b16-8ab6-d48de066f5b7

  • Anonymous
    April 12, 2012
    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!

  • Anonymous
    April 12, 2012
    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.

  • Anonymous
    April 15, 2012
    Whats the difference between WCF Data Services and the new Web API stuff supported by MVC4?

  • Anonymous
    April 18, 2012
    Has it become any easier to implement NHibernate as a DataService Provider?

  • Anonymous
    April 24, 2012
    @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?

  • Anonymous
    April 30, 2012
    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

  • Anonymous
    May 22, 2012
    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

  • Anonymous
    July 01, 2012
    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.

  • Anonymous
    August 08, 2012
    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?

  • Anonymous
    September 18, 2012
    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.

  • Anonymous
    December 17, 2012
    Is there Visual Studio 2012 support? The installer only mentions 2010.