2009-11-10 78 views
7

我试图调用WCF服务(在Windows服务,而不是IIS托管)和我得到以下错误:WCF的最大邮件大小配额

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. 有没有人知道其他配置设置可能适用于此?

回答

5

您的问题让我想起了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:

+0

谢谢!这篇文章真的很有帮助。 – manu08 2009-11-11 17:21:06

1

我认为服务器日志是指打开时创建的跟踪和日志记录文件。这是MSDN link

我在WCF中遇到的需要在应用程序中具有较高值的​​属性是maxReceivedMessageSize,maxStringContentLength,maxArrayLength和maxBufferSize。 试着增加它们,看看会发生什么。 WCF可能很难调试,因为它喜欢吞食异常。

1

可以按如下

<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> 
+1

我已经将此配置项添加到我的服务应用程序,并获取日志文件。但是,它只是显示发送消息。它并没有显示任何有关实际错误或其他反例的信息。 – manu08 2009-11-10 19:27:25

0

两件事指定应用程序配置的服务器日志和路径:

  • 你可以向我们展示服务器和客户端配置(只是相关部分 - 端点,绑定配置)

  • 你是否改变了双方(客户端和服务器)的值?

有大小设置,您可以影响整个过多....

相关问题