OData 中的限制:限制从服务器接收的数据量
如何限制从 OData 服务接收的数据量?
在 WCF 服务中,有一个我们可以限制的选项 MaxReceivedMessageSize。 Binding.MaxReceivedMessageSize ==>获取或设置使用此绑定配置的通道上可以接收的消息的最大大小。
对于 OData,有没有办法限制从服务器接收的数据量?
如何限制接收的数据量?或者它与底层 Http 协议相同吗?
谢谢文
基
How do I restrict the amount of data received from a OData service.?
In a WCF Service there is an option MaxReceivedMessageSize with which we can restrict.
Binding.MaxReceivedMessageSize ==> Gets or sets the maximum size for a message that can be received on a channel configured with this binding.
In the case of OData is there a way to restrict the amount of data received from the server?
How do I throttle the amount of data received? OR Is it same as the underlying Http protocol ?
Thanks
Venki
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信可以使用 WCF 来使用 OData feed 的媒体资源。在这种情况下,据我所知,您将能够利用 MaxReceivedMessageSize 。请考虑这篇 MSFT 博客文章:http://blogs.msdn.com/b/astoriateam/archive/2010/08/04/data-services-streaming-provider-series-implementing-a -streaming-provider-part-1.aspx
否则,我能想到的唯一方法就是实现分页。但是,根据使用 OData 服务的方式/内容,客户端可以接收所有数据并处理分页本身(也称为不是服务器端)...查看此处的最后一条评论:http://channel9.msdn.com /shows/SilverlightTV/Silverlight-TV-26-暴露-SOAP-OData-and-JSON-Endpoints-for-RIA-Services/
I believe it is possible to consume the OData feed's media resources using WCF. In which case you would be able to utilize MaxReceivedMessageSize as far as my understanding goes. Please consider this MSFT blog article: http://blogs.msdn.com/b/astoriateam/archive/2010/08/04/data-services-streaming-provider-series-implementing-a-streaming-provider-part-1.aspx
Otherwise, the only method I could think of would be implementing paging. But depending on how/what is consuming the OData service the client could be receiving all the data and handling the paging itself (aka not server side)...check out the last comment here: http://channel9.msdn.com/shows/SilverlightTV/Silverlight-TV-26-Exposing-SOAP-OData-and-JSON-Endpoints-for-RIA-Services/