c# - WCF 最大消息大小配额

标签 c# wcf wcf-binding channel

我正在尝试调用 WCF 服务(托管在 Windows 服务中,而不是 IIS),但出现以下错误:

The maximum message size quota for incoming messages has been exceeded for the remote channel. See the server logs for more details.

我曾尝试将 MaxReceivedMessageSize 和 ReaderQuotas 增加到最大值,但没有成功。

我还打开了日志记录并检查了“发送”的消息大小。它绝对离最大值还差得很远。我们讨论的是发送一个序列化为 372KB XML 的对象。

两个问题:

  1. 有谁知道该消息指的是什么“服务器日志”?我检查了 EventViewer,但那里没有任何显示...

  2. 有谁知道这里可能适用哪些其他配置设置?

最佳答案

您的问题让我想起了 Shawn Wildermuth 的一篇博文,他在一篇博文中遇到了 Silverlight 应用程序中的大消息大小问题。也许这会对您有所帮助:

http://wildermuth.com/2009/09/10/Using_Large_Message_Requests_in_Silverlight_with_WCF

肖恩说:

The trick is to change the customBinding in the web.config to use larger defaults. I picked 2MB as it its a reasonable size. Of course setting them to 2GB like shown above will work but it does leave you more vulnerable to attacks. Pick a size that isn't larger than your largest request but isn't overly large. Its a guessing game. To set these, you need to add them to your web.config is to put them on the httpTransport node:

关于c# - WCF 最大消息大小配额,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1708804/

相关文章:

c# - Playwright C# - 处理 Toast 消息

c# - 如何在asp.net web api中检测操作系统、浏览器、设备名称等设备信息?

WCF类型错误和内部服务器错误代码500?

wcf - 如何在运行时通过 URL 使用 WCF Web 服务?

c# - 具有通用属性的类必须是通用的?

java - 如果 StringBuilder 或 StringBuffer 可以做 String 做的事情,为什么我们有 String 类?

.net - iPhone/.NET WCF 互操作性

c# - 重构 “procedural” WCF服务

.net - WebInvoke 属性可以被绑定(bind)配置替换吗

c# - 使用 ACL 保护 WCF 配置文件