【问题标题】:max Array Quota reached wcf service (16384)达到 wcf 服务的最大数组配额 (16384)
【发布时间】:2014-09-12 13:47:42
【问题描述】:

我创建了一个简单的空 asp.net 网站并添加了 wcf 服务以将图像插入数据库。 我得到了最大数组配额的错误。我更改了我的客户端配置文件并达到了最大数组长度的限制。但仍然得到同样的错误。我也关注了Maximum array length quota,但我不太了解,因为我是 Visual Studio 的新手。请帮我找出错误。

这里是客户端的 app.config 文件。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_Iupload" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="2147483646"
                        maxBytesPerRead="4096" maxNameTableCharCount="5242880" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:1028/WebSite8/upload.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Iupload"
                contract="UploadRef.Iupload" name="BasicHttpBinding_Iupload" />
        </client>
    </system.serviceModel>
</configuration>

和网站的配置文件

<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <connectionStrings>
    <add name="cst" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Documents and Settings\Admin\My Documents\Visual Studio 2010\WebSites\WebSite8\App_Data\Hello.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True" />
  </connectionStrings>
    <system.web>
        <compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
    </system.web>

    <system.serviceModel>
              <behaviors>
            <serviceBehaviors>
                <behavior name="">
                    <serviceMetadata httpGetEnabled="true" />
                    <serviceDebug includeExceptionDetailInFaults="false" />
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
</configuration>

【问题讨论】:

    标签: asp.net wcf


    【解决方案1】:

    尝试在网站配置文件中的“system.serviceModel”之间添加。

    <bindings>
    
      <basicHttpBinding>
        <binding maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647" maxStringContentLength="2147483647"
                         maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
        </binding>
      </basicHttpBinding>
    
    </bindings>
    

    【讨论】:

      猜你喜欢
      • 2011-03-05
      • 1970-01-01
      • 1970-01-01
      • 2012-12-05
      • 1970-01-01
      • 1970-01-01
      • 2015-04-02
      • 2020-10-06
      • 1970-01-01
      相关资源
      最近更新 更多