简体   繁体   English

Odata压缩 - 是否有任何支持? (WinRT的WCF数据服务5.0)

[英]Odata compression - Is there ANY support? (WCF Data Services 5.0 for WinRT)

Context:Currently using WCF Data Services 5.0 with Odata for a Windows 8 Store application. 上下文:当前使用带有Odata的WCF数据服务5.0用于Windows 8应用程序。

Have been trying to compress the OData coming over the wire from my service today and running into plenty of issues surrounding support. 我一直试图压缩来自我今天服务线的OData,并遇到大量围绕支持的问题。

  • binary serialization isn't supported. 不支持二进制序列化。

  • json isn't supported (library throws 'application/json' is currently not supported in Content-Type header) 不支持json(Content-Type标头当前不支持库throws'application / json')

  • json lite isn't released yet json lite尚未发布

  • adding gzip requests in the http response works (server returns compressed) - but client side lib doesn't seem to want to deserialize it. 在http响应中添加gzip请求工作(服务器返回压缩) - 但客户端lib似乎不想反序列化它。 (xml parsing exceptions) (xml解析异常)

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. 我今天的最后一次尝试是尝试获取http响应,并自己手动反序列化流(GZipStream不可用,但我知道有第三方替代品) - 但我找不到任何Microsoft.Data。 Services.Client.WindowsStore事件/覆盖会将流公开给我。

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. 我想实现OData以利用比标准WCF Web服务更高的性能和效率 - 但是没有办法通过线路压缩流我没有得到任何。

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 您是否按照相同的步骤获取json响应。客户端必须发送MaxDataServiceVersion标头: http//blogs.msdn.com/b/astoriateam/archive/2012/04/11/what-happened-to-application- JSON-在-WCF-DS-5-0.aspx

I also checked that Odata 5.1.0 has been released on nuget. 我还检查过Odata 5.1.0已经在nuget上发布了。 This has the better json support: https://nuget.org/packages/Microsoft.Data.Services/5.1.0 这有更好的json支持: 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 您的另一个选择是使用asp.net web api并尝试odata支持: http ://www.nuget.org/packages/Microsoft.AspNet.WebApi.OData

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM