我正在尝试调用 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 的对象。
两个问题:
有谁知道该消息指的是什么“服务器日志”?我检查了 EventViewer,但那里没有任何显示...
有谁知道这里可能适用哪些其他配置设置?
最佳答案
您的问题让我想起了 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/