title: The maximum array length quota (16384) has been exceeded while reading XML data
body: <p>I am getting following error  </p>
  
  <blockquote>
    <p>The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 187231. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
  </blockquote>
  
  <p>Exception Details:</p>
  
  <blockquote>
    <p>System.Xml.XmlException: The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 187231.</p>
  </blockquote>
  
  <p>Source Error: </p>
  
  <blockquote>
    <p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  </p>
  </blockquote>
  
  <p>Stack Trace: </p>
  
  <pre><code>[XmlException: The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 187231.]
     System.Xml.XmlExceptionHelper.ThrowXmlException(XmlDictionaryReader reader, String res, String arg1, String arg2, String arg3) +311
     System.Xml.XmlExceptionHelper.ThrowMaxArrayLengthExceeded(XmlDictionaryReader reader, Int32 maxArrayLength) +59
     System.Xml.XmlBaseReader.ReadContentAsBase64() +1580759
     System.Xml.XmlDictionaryReader.ReadElementContentAsBase64() +62
     System.Runtime.Serialization.XmlReaderDelegator.ReadElementContentAsBase64() +58
     ReadPDFResponseFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) +525
     System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) +47
     System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader) +15
     System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract&amp; dataContract) +128
     System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) +39
     System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName) +167
     System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName) +98
  
  [SerializationException: There was an error deserializing the object of type Compass.GK.DataCommon.PDFResponse. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 187231.]
     System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName) +496
     System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName) +44
     System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) +52
  
  [NetDispatcherFaultException: The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:PDFRequestResult. The InnerException message was 'There was an error deserializing the object of type Compass.GK.DataCommon.PDFResponse. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 1, position 187231.'.  Please see InnerException for more details.]
     System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +7599119
     System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type) +275
     Compass.GK.Datalink.WebServiceReference.ICompassGKService.PDFRequest(Request request) +0
     Compass.GK.Datalink.RequestMaker.PDFRequest(String encryptionKey, String PDFType, String userName) +164
     GKService.GKPDFHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) in C:\Joxin\GreenekingApplication\Application\GKService\GKPDFHandler.cs:66
     System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +75
  
  my web.cofing client side entry is like this
          &lt;binding name="BasicHttpBinding_ICompassGKService" closeTimeout="00:01:00"
           openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
           allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
           maxBufferSize="2097152" maxBufferPoolSize="524288" maxReceivedMessageSize="2097152"
           messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
           useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="2097152"
              maxBytesPerRead="4096" maxNameTableCharCount="2097152" /&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None"
                realm="" /&gt;
              &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
  </code></pre>
  
  <p>I dont know anything missing ?  But  when access this locally vs.net 2008  it is working fine.</p>
  
  <p>But when i publish my application on server  then only this issue comes..</p>
  
  <p>thanks</p>
  
  <p>shaji</p>