HttpTransportBindingElement.MaxBufferSize Property

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.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public int MaxBufferSize { get; set; }

Property Value

Type: System.Int32
The maximum size, in bytes, of the buffer.

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).


Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions