OData 中的限制:限制从服务器接收的数据量

发布于 2024-09-16 23:46:00 字数 246 浏览 16 评论 0原文

如何限制从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

逆流 2024-09-23 23:46:00

我相信可以使用 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文