Wcf服务错误最大邮件大小配额

时间:2021-01-20 18:25:36

I still get this error when ı am trying the call the webservice from console application. Thanks for any idea.

当我正在尝试从控制台应用程序调用web服务时,我仍然会收到此错误。谢谢你的任何想法。

Here is my error details The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

以下是我的错误详细信息已超出传入邮件的最大邮件大小限额(65536)。要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性。

Here is my web.config file

这是我的web.config文件

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

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="bBinding"  receiveTimeout="00:10:00" closeTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647" allowCookies="true" maxReceivedMessageSize="2147483647"  maxBufferPoolSize="2147483647">

          <readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxStringContentLength="2147483647"  maxNameTableCharCount="2147483647"  maxBytesPerRead="2147483647"/>
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" />
          </security>
        </binding>
      </basicHttpBinding>
      <webHttpBinding>
        <binding name="wBinding" maxReceivedMessageSize="20000000"
                 maxBufferSize="20000000"
                 maxBufferPoolSize="20000000">
          <readerQuotas maxDepth="32"
              maxArrayLength="200000000"
              maxStringContentLength="200000000"/>
          <!--https geldiği zaman, mod transport olmalı-->
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None" />
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="srvBehavior">
          <!--https geldiği zaman httpsGetEnabled true olmalı-->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="ServiceAspNetAjaxBehavior">
          <enableWebScript/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
    <services>
      <service behaviorConfiguration="srvBehavior" name="FordDersService.FordDers">
        <endpoint address="soap" binding="basicHttpBinding" bindingConfiguration="bBinding" contract="FordDersService.IFordDers"/>
        <endpoint address="rest" binding="webHttpBinding" bindingConfiguration="wBinding" contract="FordDersService.IFordDers"  behaviorConfiguration="ServiceAspNetAjaxBehavior"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

1 个解决方案

#1


0  

<bindings>
    <basicHttpBinding>


          <binding name="basicHttp" allowCookies="true"
                     maxReceivedMessageSize="20000000" 
                     maxBufferSize="20000000"
                     maxBufferPoolSize="20000000">
                <readerQuotas maxDepth="32" 
                     maxArrayLength="200000000"
                     maxStringContentLength="200000000"/>
            </binding>
        </basicHttpBinding>
    </bindings>

#1


0  

<bindings>
    <basicHttpBinding>


          <binding name="basicHttp" allowCookies="true"
                     maxReceivedMessageSize="20000000" 
                     maxBufferSize="20000000"
                     maxBufferPoolSize="20000000">
                <readerQuotas maxDepth="32" 
                     maxArrayLength="200000000"
                     maxStringContentLength="200000000"/>
            </binding>
        </basicHttpBinding>
    </bindings>