Wcf 无法增加最大字符串内容长度配额(8192)

Wcf 无法增加最大字符串内容长度配额(8192),wcf,Wcf,我和我的同事们一直在努力解决向web服务发送超过8192字节数据的问题。我已经尝试创建一个简单的WCF项目来测试发送一些数据,但它仍然在8192+字节时失败。我已经阅读了数百个网页,并对web.config文件进行了更改,以确保元素足够大,但仍然无法工作 如有任何建议,将不胜感激 我们正在使用本地主机上的IIS Express作为web服务器测试该服务,并使用WCFTestClient向该服务发送数据。我们还尝试使用Storm作为客户端向web服务发送数据 <?xml version="1

我和我的同事们一直在努力解决向web服务发送超过8192字节数据的问题。我已经尝试创建一个简单的WCF项目来测试发送一些数据,但它仍然在8192+字节时失败。我已经阅读了数百个网页,并对web.config文件进行了更改,以确保元素足够大,但仍然无法工作

如有任何建议,将不胜感激

我们正在使用本地主机上的IIS Express作为web服务器测试该服务,并使用WCFTestClient向该服务发送数据。我们还尝试使用Storm作为客户端向web服务发送数据

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <client>
      <endpoint binding="basicHttpBinding" bindingConfiguration="NewBinding0"
        contract="IService1" name="ClientEndPointName" />
    </client>
    <services>
      <service name="Service1">
        <endpoint address="http://localhost:2787" binding="basicHttpBinding"
          bindingConfiguration="NewBinding0" name="DROServiceX" bindingName="DROBindingName"
          contract="IService1" isSystemEndpoint="false" />
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="NewBinding0" transferMode="Buffered">
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
         <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="false"
  multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

您应该在服务器端和客户端配置此选项。如果其中一个配置不正确,请求将失败。您的服务器配置正确,因此您应该查看一下客户端配置。如果你真的想知道发生了什么,开始WCF跟踪看看会发生什么


客户机也有各种超时和限制。你配置好了吗?其他的可能会有帮助。