2010-05-16 31 views
1

CommuncationException了未处理量WCF 3.0服务合同方法返回的数据的错误导致

传入的消息(65536)已被超过的最大消息大小配额。要增加配额,请在适当的绑定元素上使用MaxReceivedMessageSize属性。

这里是我的svc.map文件

<?xml version="1.0" encoding="utf-8"?> 
<ServiceReference> 
    <ProxyGenerationParameters 
     ServiceReferenceUri="http://d3w9501/SimpleWCF/SimpleWCF.svc" 
     Name="svc" 
     NotifyPropertyChange="False" 
     UseObservableCollection="False"> 
    </ProxyGenerationParameters> 
    <EndPoints> 
     <EndPoint 
      Address="http://d3w9501.americas.hpqcorp.net/SimpleWCF/SimpleWCF.svc" 
      BindingConfiguration="BasicHttpBinding_ISimpleWCF" 
      Contract="TestSimpleWCF.svc.ISimpleWCF" 
      > 
     </EndPoint> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="BasicHttpBinding_ISimpleWCF" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" > 
      <security mode="None" /> 
     </binding> 
     </basicHttpBinding> 
    </bindings>  
    </EndPoints> 
</ServiceReference> 

回答

2

的svc.map文件并不能真正帮助很大 - 我们需要看到能够帮助在客户端的app.config文件 - 那是一个真正相信的人。

另外:您需要更改您的app.config中的客户端值 - 而不是您的svc.map - 以便对正在运行的应用程序产生任何影响。检查这些值是否仍然是app.config中的默认值64K - 如果是这样,请在那里更改它们!

0

找到app.config文件。 将maxBufferSize和maxReceivedMessageSize从65536更改为2147483647 现在,来自控制台客户端的消息已消失。

非常感谢。