HttpTransportBindingElement.MaxBufferSize Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the maximum size of the buffer to use. For buffered messages this value is the same as MaxReceivedMessageSize. For streamed messages, this value is the maximum size of the SOAP headers, which must be read in buffered mode.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
For streamed messages, if the size of the message headers is greater than this property, then a QuotaExceededException is thrown. For a non-streamed message, if the message size is greater than this property, then the message is dropped.
If not specified, this defaults to 65536.
// Create an instance of the HttpTransportBindingElement HttpTransportBindingElement httpTransportBindingElement = new HttpTransportBindingElement(); string txtDefaultMaxBufferSize = httpTransportBindingElement.MaxBufferSize.ToString(); txtOutput1.Text = txtDefaultMaxBufferSize; //The value is 65536 (0x10000). // Change the maximum buffer size. httpTransportBindingElement.MaxBufferSize = 0x20000; string txtNewMaxBufferSize = httpTransportBindingElement.MaxBufferSize.ToString(); txtOutput2.Text = txtNewMaxBufferSize; //The value is 131072 (0x20000).