WCF错误,System.ServiceModel.CommunicationException已超出传入邮件的最大邮件大小配额 [英] WCF error, System.ServiceModel.CommunicationException the maximum message size quota for incoming messages has been exceeded

查看:126
本文介绍了WCF错误,System.ServiceModel.CommunicationException已超出传入邮件的最大邮件大小配额的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们看到与http文件传输请求相关的此错误



WCF错误,System.ServiceModel.CommunicationException已超出传入邮件的最大邮件大小配额。



我看过几条与此消息相关的帖子,其中一般反应只是将其提升到最大值。



如果要强制限制文件传输大小,该怎么办?我们希望允许用户仅传输60MB(62914560)和更小的文件。



哪个设置应该设置为62914560? maxStringContentLength或maxArrayLength?



请求周围的信封是否有开销?换句话说,最大允许下载文件大小是60MB?或者它是否更小,文件大小+请求开销< = 60MB?



如果是后者,可以确定。开销固定大小?或者开销是其他设置的函数(例如-maxBytesPerRead)?



SSL会影响文件(整体消息)的大小吗?多少钱?



我正试图弄清楚它是如何工作的。改变大小似乎是任意的。我如何知道允许下载仅60MB或更少的文件的正确设置值是什么。我看到的一件事是,53776931字节的zip文件将抛出异常。在下载之前,我正在检查文件的大小,它显然小于60MB。是什么导致邮件超过最大邮件大小?

We are seeing this error related to an http file transfer request

WCF error, System.ServiceModel.CommunicationException the maximum message size quota for incoming messages has been exceeded.

I've seen several posts related to this message, with the general response of just bump it to the max.

What if you want to force a limit on the file transfer size. We want to allow the user to only transfer files 60MB(62914560) and smaller.

Which setting should be set to 62914560? maxStringContentLength or maxArrayLength?

Is there overhead for the envelope around the request? In other words will the max allowed download file size be 60MB? Or is it smaller, file size + request overhead <= 60MB?

If it is the latter, can this be determined. Is the overhead fixed size? Or is the overhead a function of other settings (eg-maxBytesPerRead)?

Does SSL impact the file (overall message) size? How much?

I'm trying to understand exactly how it works. Changing the size seems arbitrary. How do I know what the correct setting value is to allow downloads of files that are only 60MB or less. One of the things I am seeing is that a zip file of 53776931 bytes will throw the exception. Prior to the download, I'm checking the size of the file and it is clearly less than 60MB. What is causing the message to exceed the maximum message size?

推荐答案

增加 maxStringContentLength 大小。



SSL不会影响大小。即使这样做,SSL的优势也超过了大小问题。
Increase the maxStringContentLength size.

SSL does not impact size. Even if it did, the advantages of SSL outweigh the size issue.


设置必须同时应用于客户端和SERVER端。
Setting must be applied to both the client and the SERVER sides.


这篇关于WCF错误,System.ServiceModel.CommunicationException已超出传入邮件的最大邮件大小配额的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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