简体   繁体   English

WCF最大邮件大小配额

[英]WCF Maximum Message Size Quota

I'm trying to call a WCF service (hosted in a Windows Service, not IIS) and am getting the following error: 我正在尝试调用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. 有关详细信息,请参阅服务器日志

I have tried increasing the MaxReceivedMessageSize and the ReaderQuotas to their maximum values without any luck. 我已经尝试将MaxReceivedMessageSize和ReaderQuotas增加到它们的最大值而没有任何运气。

I have also turned on logging and checked the messsage size that's getting "sent." 我还打开了日志记录并检查了“发送”的消息大小。 It's definitely nowhere near the maximum. 它绝对没有接近最大值。 We're talking about sending an object that serialized into 372KB XML. 我们正在谈论发送一个序列化为372KB XML的对象。

Two questions: 两个问题:

  1. Does anyone know what "server logs" the message is referring to? 有谁知道消息所指的“服务器日志”是什么? I've checked the EventViewer but nothing shows up there... 我检查过EventViewer但没有显示出来......

  2. Does anyone know what other configuration setting(s) might apply here? 有谁知道这里可能适用的其他配置设置?

Your question reminded me of a blog post by Shawn Wildermuth where he was having trouble with Large Message Sizes in a Silverlight application. 您的问题让我想起了Shawn Wildermuth的博客文章,他在Silverlight应用程序中遇到了大消息大小的问题。 Perhaps this will help you out: 也许这会帮助你:

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

Shawn says: 肖恩说:

The trick is to change the customBinding in the web.config to use larger defaults. 诀窍是更改web.config中的customBinding以使用更大的默认值。 I picked 2MB as it its a reasonable size. 我选了2MB,因为它的大小合理。 Of course setting them to 2GB like shown above will work but it does leave you more vulnerable to attacks. 当然,如上所示将它们设置为2GB也可以工作,但它确实让你更容易受到攻击。 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: 要设置它们,您需要将它们添加到您的web.config是将它们放在httpTransport节点上:

I think server logs means the tracing and logging files which are created when you turn that on. 我认为服务器日志意味着当您打开它时创建的跟踪和日志记录文件。 Here's the MSDN link . 这是MSDN链接

The properties which I run into with WCF that need to have a higher value in the applications I write are maxReceivedMessageSize, maxStringContentLength, maxArrayLength and maxBufferSize. 我在WCF中遇到的属性需要在我编写的应用程序中具有更高的值,这些属性是maxReceivedMessageSize,maxStringContentLength,maxArrayLength和maxBufferSize。 Try to increase them and see what happens. 尝试增加它们,看看会发生什么。 WCF can be a pain to debug as it is fond to swallow exceptions. WCF可能很难调试,因为它喜欢吞下异常。

You can specify the server logs and path in the application config as follows 您可以在应用程序配置中指定服务器日志和路径,如下所示

 <system.diagnostics>
    <trace autoflush="true" />
    <sources>
      <source name="System.ServiceModel"

                    switchValue="Critical, Error, Warning"
              >
        <listeners>
          <add name="traceListener"
                        type="System.Diagnostics.XmlWriterTraceListener"
                        initializeData="F:\log-data\ServiceTrace.svclog"
            />
        </listeners>
      </source>
    </sources>

  </system.diagnostics>

Two things: 两件事情:

  • can you show us the server and client side config (just the relevant sections - endpoints, binding configuration) 你能告诉我们服务器和客户端配置(只是相关部分 - 端点,绑定配置)

  • did you change the values on both sides (client and server)?? 你是否改变了双方(客户和服务器)的价值?

There's a whole plethora of size settings you can influence.... 你可以影响很多大小的设置....

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WCF 服务 增加最大消息大小配额和配置 - WCF Service Increase maximum message size quota and configuration 超出了传入消息的最大消息大小配额(65536)。 Silverlight + WCF - The maximum message size quota for incoming messages (65536) has been exceeded. Silverlight+ WCF WCF错误:System.ServiceModel.CommunicationException已超过传入消息的最大消息大小配额 - WCF error: System.ServiceModel.CommunicationException the maximum message size quota for incoming messages has been exceeded WCF,已超过传入消息的最大消息大小配额(65536) - WCF, The maximum message size quota for incoming messages (65536) has been exceeded WCF 异常:已超出传入消息的最大消息大小配额 (65536) - WCF Exception: The maximum message size quota for incoming messages (65536) has been exceeded 已超出传入邮件的最大邮件大小限额(65536) - The maximum message size quota for incoming messages (65536) has been exceeded 单元测试AIF的错误消息:已超出传入邮件的最大邮件大小配额 - Error message why unit testing AIF: Maximum message size quota for incoming messages has been exceeded “已超出传入邮件的最大邮件大小限额(65536)。” 即使设定了更大的尺寸 - “The maximum message size quota for incoming messages (65536) has been exceeded.”. Even after setting greater size WCF阅读器配额最大字符串内容长度配额(8192) - WCF reader quota The maximum string content length quota (8192) 错误:外部DLL已超过传入消息的最大消息大小配额(65536) - Error: maximum message size quota for incoming messages (65536) has been exceeded from external DLL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM