c# - "The maximum message size quota for incoming messages (65536) has been exceeded."。即使在设置更大的尺寸之后

标签 c# .net winforms wcf web-services

我正在尝试从 Windows 窗体客户端应用程序访问 WCF 服务。我在服务器上的绑定(bind)配置是这样的:

 <bindings>
      <customBinding>
        <binding name="Wrabind" closeTimeout="00:05:00" openTimeout="00:05:00"
            sendTimeout="00:25:00">
          <textMessageEncoding />
          <security authenticationMode="SecureConversation" includeTimestamp="true"
              messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
            <localClientSettings maxClockSkew="00:30:00" />
            <localServiceSettings maxClockSkew="00:30:00" />
            <secureConversationBootstrap messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
              <localClientSettings maxClockSkew="00:30:00" />
              <localServiceSettings maxClockSkew="00:30:00" />
            </secureConversationBootstrap>
          </security>
          <httpTransport maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000"
              allowCookies="true" maxBufferSize="20000000" />
        </binding>
      </customBinding>
    </bindings>

如您所见,我已经将 maxReceivedMessageSize 设置为 20000000,但它仍然显示 “已超出传入消息的最大消息大小配额 (65536)。”异常(exception)。我错过了什么吗?

最佳答案

也许这个错误来自客户端而不是服务器。确保客户端配置中存在相同的设置。

关于c# - "The maximum message size quota for incoming messages (65536) has been exceeded."。即使在设置更大的尺寸之后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18430573/

相关文章:

c# - 休眠 : saving and retrieving a file to/from database

C# 在客户端和服务器上使用 TcpListener

.net - Vb.net 两个逗号分隔的列表

c# - 使用属性防止在 ASP.NET MVC 中缓存特定操作

c# - Azure Functions Newtonsoft.Json 加载错误

c# - 参数比方法更难访问

.net - 创建 UI 设计师

c# - 在执行 C# 之前检查 linq 操作是否为空

c# - 我安装的应用程序不工作

c# - 在 Winforms 中使用 Graph# 的示例