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
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
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?
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
OK - I'll bite - can I use actions when I'm using EntityFramework? Any doco on how to do this?
Silverlight 4? what's about Silverlight 5?
How can we query via url the multivalue fields...i get a error whe using "any" ...
Does new version start supporting join and other stuff along with any and All.
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:
www.odata.org/.../an-efficient-format-for-odata
www.odata.org/.../format-efficiency-take-2-really-clean-json
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
@Piquet
Checkout the latest blog post - the start of a 3 part series on Actions. :)
@Rui
Try something like this: ~/Service/Movies?$filter=Tags/any(t: t eq 'Cool')
where Tags is a Collection(Edm.String).
data.svc/Classes$expand=Children
where Children is many-to-many relation is broken in RTM, October CTP worked just fine :(
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
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!
I posted my previous question to the data services forum here:
social.msdn.microsoft.com/.../ffeee9e2-b96c-4b16-8ab6-d48de066f5b7
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!