2011-11-18 62 views
1

我正在从我的WCF Web服务读取字节数组中的pdf,并将其返回给Web应用程序以临时准备文件。但不知何故,我得到这个例外:从WCF服务读取Byte数组到ASP.NET MVC时获取Maximumsize问题3

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element 

从WCF服务读取字节数组。

我在Web应用程序中的绑定标记如下。 我试图用2147483647替换号码104857600。但问题仍然存在。 有人可以帮忙吗?我错过了什么?

<binding name="BasicHttpBinding_IService" closeTimeout="00:10:00" 
      openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" 
      allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
      maxBufferSize="104857600" maxBufferPoolSize="104857600" maxReceivedMessageSize="104857600" 
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
      useDefaultWebProxy="true"> 
      <readerQuotas maxDepth="104857600" maxStringContentLength="104857600" maxArrayLength="104857600" 
      maxBytesPerRead="104857600" maxNameTableCharCount="104857600" /> 
      <security mode="None"> 
      <transport clientCredentialType="None" proxyCredentialType="None" 
       realm="" /> 
      <message clientCredentialType="UserName" algorithmSuite="Default" /> 
      </security> 
     </binding> 

回答

1

您可能还需要在WCF服务主机上包含这些相同的绑定配置。

参见this post作为参考。

+0

该帖子对我来说是有用的...它的工作...谢谢 –