WebMethodAttribute::BufferResponse Property
Gets or sets whether the response for this request is buffered.
Assembly: System.Web.Services (in System.Web.Services.dll)
Property Value
Type: System::Booleantrue if the response for this request is buffered; otherwise, false. The default is true.
Setting BufferResponse to true, serializes the response of the XML Web service method into a memory buffer until either the response is completely serialized or the buffer is full. Once the response is buffered, it is returned to the XML Web service client over the network. When BufferResponse is false, the response to the XML Web service method is sent back to the client as it is serialized. In general, you only want to set BufferResponse to false, if it is known that an XML Web service method returns large amounts of data to the client. For smaller amounts of data, XML Web service performance is better with BufferResponse to true.
When BufferResponse is false, SOAP extensions are disabled for the XML Web service method.
The following code example sets the BufferResponse property to false and handles the streaming of a text file back to the client. The code example demonstrates how to stream a large piece of data back to the client using a class that implements the IEnumerable interface.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.