title: How to upload files larger than 16k to a WCF-service?
body: <p>To make a long story short:</p>
  
  <ul>
  <li><p>Making a web application</p></li>
  <li><p>Each user profile contains exactly one profile image, which is stored in the database</p></li>
  <li><p>The bottom layer uses ADO.NET entity framework for data access and relationships between classes</p></li>
  <li><p>Inserting images into the database on the bottom data access layer of the application works fine</p></li>
  <li><p>On the top layer, in an MVC application, we use WCF to get the profile image to display. Displaying the image works fine no matter what the size, meaning that uploading images is the only problem.</p></li>
  <li><p>In my Upload picture-function i can upload pictures up to 16k. Nothing bigger.</p></li>
  <li><p>I have found all <code>maxBufferSize</code> and <code>maxReceivedMessageSize</code> properties in all app.config and web.config-files in the solution, and changed the values to 1MB (1 048 576)</p></li>
  </ul>
  
  <p>This is the error i get:</p>
  
  <blockquote>
    <p>The formatter threw an exception while
    trying to deserialize the message:
    There was an error while trying to
    deserialize parameter
    <a href="http://www.mydomain.com/contracts/profile/2009/07:userProfile" rel="nofollow noreferrer">http://www.mydomain.com/contracts/profile/2009/07:userProfile</a>.
    The InnerException message was 'There
    was an error deserializing the object
    of type
    Myproject.Commons.BusinessObjects.UserProfile.
    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 44978.'. 
    Please see InnerException for more
    details.</p>
  </blockquote>
  
  <p>It also tells me that the source file of the error is Reference.cs within the service reference.
  ...and now i basically cannot understand where this really comes from. Anyone has a clue?</p>