已超出传入邮件的最大邮件大小限额(33554431)

时间:2015-07-01 06:04:35

标签: asp.net web-services

我的客户端应用程序正在调用Web服务,一切正常,但函数调用总是抛出此错误(已超出传入消息的最大邮件大小限额(33554431)。)

我曾尝试将客户端应用程序的app.config文件中的maxBufferSize增加到335544310,但它无助于解决此问题。

 <system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="basicHttpsEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
                     hostNameComparisonMode="StrongWildcard" maxBufferSize="33554431" maxBufferPoolSize="33554431" maxReceivedMessageSize="33554431" messageEncoding="Text" textEncoding="utf-8"
                     transferMode="Buffered" useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="33554431" maxArrayLength="33554431" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="Transport">
                    <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://api.smartmailpro.com/2.0/API.svc" binding="basicHttpBinding" bindingConfiguration="basicHttpsEndpoint" contract="SmartMailProApi.API" name="basicHttpsEndpoint" />
    </client>
</system.serviceModel>

我怀疑有两种可能性

1)我使用的值太大了 2)我还需要对服务器Web服务执行相同的更新

有人能指出我正确的方向吗?

遵循三个参数的真正目的是什么:

 maxBufferSize="33554431" 
 maxBufferPoolSize="33554431" 
 maxReceivedMessageSize="33554431"

1 个答案:

答案 0 :(得分:0)

将maxBufferSize的值放大到2147483647,并解决了问题。