配置控制台应用程序以从wcf接收超过65536

时间:2010-05-16 18:00:14

标签: wcf console c#-2.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>

1 个答案:

答案 0 :(得分:0)

您需要将app.config中的MaxReceivedMessageSize设置为更高的值。

喜欢这里: alt text http://geekswithblogs.net/images/geekswithblogs_net/niemguy/7378/o_02%20-%20Properties%20BasicHttpBinding.jpg