Click here to Skip to main content
14,978,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello all,

Thanks in advance for your answers.

Issue while posting PDF document with size above 65536 bytes.

We have a business entity with array of bytes property which holds the PDF document. While attaching the business entity to the HTTP Content we are getting an error saying “Cannot write more bytes to the buffer than the configured maximum buffer size: 65536.”. The following is the code which is giving an exception.
C#
HttpContent content = new ObjectContent<business entity="" with="" array="" of="" bytes="" property="">(email, "text/xml");

We have tried increasing the maxBufferSize and maxReceivedMessageSize in the web config basicHttpBinding but didn’t worked.

NOTE: I am using VS4.0.
Posted
Updated 10-Oct-12 23:32pm
v4

1 solution

I assume you have worked this issue out by now, but just in case you haven't. Sometimes that error can occur if the response is too large, so you would additionally need to set the MaxResponseContentBufferSize. Have you tried that yet?
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900