【发布时间】:2015-07-01 06:04:34
【问题描述】:
我的客户端应用程序正在调用 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"
【问题讨论】:
-
看来你要发送大消息
-
您好,普拉内,谢谢。你会建议我增加 web 服务的 maxBufferSize 的值吗?
-
你说得对,可能这个方法获取的数据太大
标签: asp.net web-services