Click here to Skip to main content
13,146,402 members (44,672 online)
Rate this:
Please Sign up or sign in to vote.
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.
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 10-Oct-12 20:11pm
Updated 10-Oct-12 23:32pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 12 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100