WCF Data Services 5.6.0 Release


Recently we released updated NuGet packages for WCF Data Services 5.6.0. You will need the updated tooling (released today) to use the portable libraries feature mentioned below with code gen.

What is in the release:

Visual Studio 2013 Support

The WCF DS 5.6.0 tooling installer has support for Visual Studio 2013. If you are using Visual Studio 2013 and would like to consume OData services, you can use this tooling installer to get Add Service Reference support for OData. Should you need to use one of our prior runtimes, you can still do so using the normal NuGet package management commands (you will need to uninstall the installed WCF DS NuGet packages and install the older WCF DS NuGet packages).

Portable Libraries

All of our client-side libraries now have portable library support. This means that you can now use the new JSON format in Windows Phone and Windows Store apps. The core libraries have portable library support for .NET 4.0, Silverlight 5, Windows Phone 8 and Windows Store apps. The WCF DS client has portable library support for .NET 4.5, Silverlight 5, Windows Phone 8 and Windows Store apps. Please note that this version of the client does not have tombstoning, so if you need that feature for Windows Phone apps you will need to continue using the Windows Phone-specific tooling.

URI Parser Integration

The URI parser is now integrated into the WCF Data Services server bits, which means that the URI parser is capable of parsing any URL supported in WCF DS. We have also added support for parsing functions in the URI Parser.

Public Provider Improvements – Reverted

In the 5.5.0 release we started working on making our providers public. In this release we hoped to make it possible to override the behavior of included providers with respect to properties that don’t have native support in OData v3, for instance enum and spatial properties. Unfortunately we ran into some non-trivial bugs with $select and $orderby and needed to cut the feature for this release.

Public Transport Layer

In the 5.4.0 release we added the concept of a request and response pipeline to WCF Data Service Client. In this release we have made it possible for developers to directly handle the request and response streams themselves. This was built on top of ODataLib’s IODataRequestMessage and IODataResponseMessage framework that specifies how requests and responses are sent and recieved. With this addition developers are able to tweak the request and response streams or even completely replace the HTTP layer if they so desire. We are working on a blog post and sample documenting how to use this functionality.

Breaking Changes

In this release we took a couple of breaking changes. As these bugs are tremendously unlikely to affect anyone, we opted not to increment the major version number but we wanted everyone to be aware of what they were:

  • Developers using the reading/writing pipeline must write to Entry rather than Entity on the WritingEntryArgs
  • Developers should no longer expect to be able to modify the navigation property source in OnNavigationLinkStarting and OnNavigationLinkEnding
  • Developers making use of the DisablePrimitiveTypeConversion knob may see a minor change in their JSON payloads; the knob previously only worked for the ATOM format

Bug Fixes

  • Fixes a performance issue with models that have lots of navigation properties
  • Fixes a performance issue with the new JSON format when creating or deleting items
  • Fixes a bug where DisablePrimitiveTypeConversion would cause property type annotations to be ignored in the new JSON format
  • Fixes a bug where LoadProperty does not remove elements from a collection after deleting a link
  • Fixes an issue where the URI Parser would not properly bind an action to a collection of entities
  • Improves some error messages

Known Issues

The NuGet runtime in Visual Studio needs to be 2.0+ for Add Service Reference to work properly. If you are having issues with Add Service Reference in Visual Studio 2012, please ensure that NuGet is up-to-date.

Comments (18)

  1. Ricardo Peres says:

    When are you planning to add OData 4 support?

  2. Does this release include EF 6 support?

  3. cwoodruff says:

    When will tombstoning be added back into the mix? Or does it conflict with portable library support?

  4. Daniel says:

    Does this release handle EF DbGeography types?  Previous releases used their own versions, which were incompatible with EF.

  5. michele fioretto says:

    Support for geometry spatial of entity Framework?

    users are waiting this bug fix for Long time

  6. Michael says:

    When refreshing data that is persisted, the OnPropertyChanged event is raised for every property in every data object, this can cause a lot of slowdown.

    Would you be able to update the automatic code generated in Reference.cs, so the set methods check if the new value is the same as the old, before calling OnPropertyChanged?

    Is there any way I can change the code format generated in Reference.cs (other than manually of course!)?

  7. DotNetWise says:

    When are you planning to add OData 4 support?

  8. Martin says:

    How do I activate it in the express editions after installtion?

  9. @Ricardo/@DotNetWise – OData v4 support is coming in a different stack. We actually plan to upload the first alpha of ODataLib very soon. It will have a different NuGet package/assembly name/namespaces as the v4 version will only support v4. Hopefully we'll get a blog post together on that soon.

    @jvrobert – Sort of. The EF 6 support will come in a different NuGet package, which will go into alpha today.

    @Chris – Great question, but unfortunately I don't know. I don't think it conflicts with portable libraries (though it might), it's just that we haven't gotten to that work in the portable library specifically.

    @Daniel/Michele – Also a good question. We went a LONG way down that road, but ran into some pretty nasty issues when we got to $select. Unfortunately we couldn't find a good way around the issues, so although we had intended to publish a sample showing how to do this, we actually had to revert code because of the problems we ran into.

    @Michael – Another thing we're working on (finally!) is a T4 template for code gen. While I don't think we'll back port this to our v3 stack, at least you can take heart that you'll be able to modify the T4 template to your hearts content in the near future. (You could probably also modify the T4 template to work with our v3 stack, even if we don't.) And just to head off the next question, near future = next few months.

    @Martin – There's no need to "activate" to the best of my knowledge. For client-side stuff we still use Add Service Reference, and for server-side stuff we still use an item template. Are you not seeing one of those two things?

  10. Andras says:

    When will be the Public Transport Layer example available? I have to use compression to my output, so I'd like to use gzip with that feature. Will I be able to do it?

  11. m.f.cardoso says:

    Bug in WCF Data Services 5.6 using IExpandProvider, returning a record through the entity's key

    We have a class that implements the interfaces IUpdatable, IExpandProvider. For implementation of the methods of these interfaces use the Entity Framework 6.

    When we run a query from the address below is showing an error at the end of execution:

    http://localhost:15547/BloggingService.svc/Blogs(1)?$expand=Posts

    We have identified that the information is returned correctly, but due to the error, an exception is included at the end of the XML. Below is the error displayed: "Cannot transition from state 'Completed' to state 'Error'. Nothing further can be written once the writer has completed."

    The query used in the previous example has been rewritten and thus we obtain the expected information without errors. Used following URL:

    http://localhost:15547/BloggingService.svc/Blogs?$filter=BlogId%20eq%202&$expand=Posts

    As the error appears not helped us identify the problem, we decided to debug the components of WCF Data Services. With this, we found that the method WriteRequest (QueryResultInfo queryResults) of the class System.Data.Services.Serializers.Serializer.cs, performs a validation that generates the following error message:

    • A single resource was expected for the result, but multiple resources were found.

    For our analysis, validation that generates the error should not exist, since the serialization data, which were requested by the URL, has been performed correctly.

    Furthermore, this error is not encapsulated in the InnerException of the exception shown in XMLwhich makes it difficult its identification. This is occurring due to a validation method IODataOutputInStreamErrorListener.OnInStreamError () of the class Microsoft.Data.OData.ODataWriterCore.cs, that checks the status of the XML serialization process was completed. If so, the exception shown in the XML is triggered, disregarding any exception that occurred.

    Therefore, we conclude that there is no reason for these errors occur in this situation presented. Furthermore, the exception shown does not reflect the error occurred, making it difficult to identify.

    For more information, visit connect.microsoft.com/…/bug-no-wcf-data-services-5-6-utilizando-iexpandprovider-ao-retornar-um-registro-atr-ves-da-chave-da-entidade

  12. Prasad G says:

    I'm unable to install "WCF Data Services Client for Windows Store Apps" on my laptop running Windows 8.1 and has VS2013. Other mates from my team with same hw & sw configuration were able to install. Please help.

  13. michele fioretto says:

    @Mark Stafford

    Hi Mark, actually I'm using code first and wcf data services. In order to handle gis data within ODATA, I had to converted all geometry (Shape Column) into wkt (ogc simple feature) using a column "ShapeWKT" [nvarchar max]. The editing from desktop (quantum gis) is made on geometry column, while the editing from browser is made on ShapeWKT using openlayers. In order to syncronize both data, I had to implement triggers.

    So It is not really good and stable solution but it works.

    Can You give the date when wcf data services can works with geometry native type?

    thanks

    Michele

  14. decimal类型字段4位小数,保存时被截断 says:

    decimal类型字段4位小数,保存时被截断为2位小数

    public class NN

    {

       decimal mValue { get;set; }

    }

    NN.mValue = 1.2312;

    db.UpdateObject(NN);

    db.SaveChanges;

    decimal  m = db.NN.Frist().mValue;

    m 为 1.23

  15. Justin zeng says:

    Is IODataRequestMessage documenting?

    I need to replaced the stream to compress request stream,

    but i don't know what to do!

  16. Justin Zeng says:

    Is there any document shows how to use Public Transport Layer?

  17. Jason Moore says:

    > We are working on a blog post and sample documenting how to use this functionality.

    So, have you put this together yet?

  18. projectdd says:

    vs2013 portable class library still not surport the 'DataServiceKey'

    attribute, that is ver importent attribute for poco code first entity ,if do not ,the portable class library has

    no define poco entitys for wcf data service model