开发者

How to increase MaxStringContentLength?

开发者 https://www.devze.com 2023-04-11 17:44 出处:网络
When I download xml file which are larger than 1Mb, I have an error : The maximum message size quota for incoming messages (8192) has been exceeded. To increase the quota, use the MaxReceivedMessageS

When I download xml file which are larger than 1Mb, I have an error :

The maximum message size quota for incoming messages (8192) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

I tryied to increase the MaxReceivedMessageSize value in the web.config file but it didn't work. Does someone know a solution ?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.web>
<customErrors mode="Off"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" >
</compilation>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

  <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <services>
      <service
        behaviorConfiguration="ServiceGatewayBehavior"
        name="Marketing.WebService.Administration">
        <endpoint
          address=""
          binding="wsHttpBinding"
          bindingConfi开发者_如何学JAVAguration="CustomBinding"
          contract="Marketing.WebService.Interfaces.IAdministration" />
      </service>
    </services>
    <bindings>
      <wsHttpBinding>
        <binding name="CustomBinding">
          <readerQuotas
              maxArrayLength="2147483647"
              maxBytesPerRead="2147483647"
              maxDepth="2147483647"
              maxNameTableCharCount="2147483647"
              maxStringContentLength="2147483647" />
          <security mode="None">
            <message establishSecurityContext="false" />
            <transport clientCredentialType="None"/>
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceGatewayBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号