0

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

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

这是我的 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>
4

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>
于 2015-02-03T10:19:56.220 回答