Context:Currently using WCF Data Services 5.0 with Odata for a Windows 8 Store application.
Have been trying to compress the OData coming over the wire from my service today and running into plenty of issues surrounding support.
binary serialization isn't supported.
json isn't supported (library throws 'application/json' is currently not supported in Content-Type header)
json lite isn't released yet
adding gzip requests in the http response works (server returns compressed) - but client side lib doesn't seem to want to deserialize it. (xml parsing exceptions)
My final attempt today was to try and get a hold of the http response, and to manually deserialize the stream myself (GZipStream isn't available but i know there are 3rd party alternatives) - but I couldn't find ANY Microsoft.Data.Services.Client.WindowsStore events/overrides that would expose the stream to me.
I wanted to implement OData to leverage the performance and efficiency gains over standard WCF Web services - but with no way to compress the stream over the wire i don't get any.
Does anyone have any experience with this, or advice of how to approach?
Have you followed the same steps here to get json response.The client has to send MaxDataServiceVersion header: http://blogs.msdn.com/b/astoriateam/archive/2012/04/11/what-happened-to-application-json-in-wcf-ds-5-0.aspx
I also checked that Odata 5.1.0 has been released on nuget. This has the better json support: https://nuget.org/packages/Microsoft.Data.Services/5.1.0
Your other option is to use asp.net web api and try the odata support: http://www.nuget.org/packages/Microsoft.AspNet.WebApi.OData
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With