WCF MaxReceivedMessageSize异常 [英] WCF MaxReceivedMessageSize Exception

查看:128
本文介绍了WCF MaxReceivedMessageSize异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在尝试从数据库中获取数据时遇到此异常。



已超出传入邮件的最大邮件大小限额(65536)。要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性。



但我们可以通过增加 MaxReceivedMessageSize的值来解决此问题在app.config中。



我的问题是,如果我们有数百万的数据,那么这个问题的解决方案是什么。





谢谢

Kishore

Hi all,

I am getting this exception when trying to get data from the database.

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

But we can solve this issue by increasing the value of MaxReceivedMessageSize in app.config.

My Question is if we have millions of data then what is the solution for this issue.


Thanks
Kishore

推荐答案

将其分解成块。它只是达到了单独的消息大小限制,所以,例如,如果您正在传输数据集合,则将其以块的形式发送,而不是一次性发送。
Break it down into chunks. It is only the individual message size limit that is being reached so, if for example you are transmitting a collection of data, send it in chunks rather than all at once.


是的,我同意使用解决方案1作为Chunking将是最优选的解决方案而不是增加服务的缓冲区(配额)限制,因为一旦设置了配额,那么即使对于少量数据也总是不需要分配大的缓冲区。



分块可以实现,例如,根据网格中选择的页码获取大量数据(应该启用分页)。





我希望很清楚,但如果您有任何疑问,请告诉我。
Yes, I agree with Solution 1 as Chunking would be the most preferrable solution rather than increasing the buffer (quota) limits of a Service because once quota is set then always that much big buffer would be allocated unnecessary even for small amount of data.

Chunking can be implemented, for example, by getting chunk of data as per the Page number selected in a Grid (Paging should be enabled).


I hope it was clear but if you get any queries please let me know.


这篇关于WCF MaxReceivedMessageSize异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆