title: Changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader
body: <p>I'm getting the following exception while sending ( or receiving )  a byte array to a C# service. </p>
  
  <pre><code>There was an error deserializing the object of type System.Byte[]. 
  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 6, position 34838.'.  
  Please see InnerException for more details
  </code></pre>
  
  <p>For what I can understand the XmlDictionaryreader is created automatically by the webservice.</p>
  
  <p>So, how can I change the "MaxArrayLength" property?</p>
  
  <p>This is the implementation code:</p>
  
  <pre><code>    public string addFile(string sharePointServer, string documentLibrary, 
                            byte[] content, string fileName) 
      {
          try
          {
              SPWeb spWeb = new SPSite(sharePointServer).OpenWeb();
              SPFolder spFolder = spWeb.GetFolder(documentLibrary);
              SPFileCollection spFileCollection = spFolder.Files;
              SPFile spFile = spFileCollection.Add(fileName, content, true);
              return spFile.TimeCreated.ToLongDateString() + "::" + spFile.Title;
          } 
              catch (Exception ex) 
          {
              throw ex;
          }
      }
  </code></pre>
  
  <p>Files &lt; 16kb are uploaded. </p>
  
  <p>Files > 16kb are not. </p>
  
  <p>Files > 10mb are downloaded without problem.</p>
  
  <p>Where is that property configured?</p>