0

I have created a simple empty asp.net website and added wcf service to insert image to a database. and i am getting the error of max array quota. i changed my client config file and up the limit of max array length. but still getting the same error. i also followed this Maximum array length quota but i don't understand much because i am newbie to to visual studio. please help me finding the mistake.

here is client's app.config file.

<?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>

and website's config file

<?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>
Community
  • 1
  • 1
Sahil Manchanda
  • 9,812
  • 4
  • 39
  • 89

1 Answers1

0

try add this between "system.serviceModel" in website's config file.

<bindings>

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

</bindings>
Roson
  • 1
  • 4