Click here to Skip to main content
11,478,066 members (69,911 online)
Rate this: bad
good
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 21:11pm
sowvin461
Edited 11-Oct-12 0:32am
v4

1 solution

Rate this: bad
good
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?
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 219
1 F-ES Sitecore 170
2 Sascha Lefèvre 170
3 Frankie-C 110
4 OriginalGriff 95
0 Sergey Alexandrovich Kryukov 7,675
1 OriginalGriff 7,321
2 Sascha Lefèvre 3,034
3 Maciej Los 2,491
4 Richard Deeming 2,325


Advertise | Privacy | Mobile
Web01 | 2.8.150520.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