Click here to Skip to main content
11,799,282 members (76,719 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET WCF VS2010 REST
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
Edited 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
0 OriginalGriff 473
1 CPallini 410
2 Richard MacCutchan 319
3 phil.o 244
4 Kornfeld Eliyahu Peter 205
0 OriginalGriff 2,475
1 Maciej Los 1,860
2 KrunalRohit 1,496
3 CPallini 1,465
4 Richard MacCutchan 1,149

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 12 Nov 2012
Copyright © CodeProject, 1999-2015
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