You can use the BufferResponce property to control when the data returned from the web service is sent to the client. The property is set to true by default. In this case the entire result is serialized before it is sent to the client. By setting this property to false, ASP.NET starts returning output as it is serialized.

C# 8.0 and .NET Core 3.0 – Modern Cross-Platform Development: Build applications with C#, .NET Core, Entity Framework Core, ASP.NET Core, and ML.NET using Visual Studio Code, 4th Edition
ASP.NET Core 3 and Angular 9: Full stack web development with .NET Core 3.1 and Angular 9, 3rd Edition
C# in Depth, 4th Edition


public byte[] GetLargeStreamOfData()

{ … }

The web service method always finishes executing before anything is returned. The BufferResponse setting applies to the serialization that takes place after the method has executed. With buffering turned off, the first part of the result is serialized and sent. Then the next part of the result is serialized and sent, and so on.

You can set BufferResponse only when the web service returns a large amount of data. This means that the proxy class will still wait for all the information to be received before it passes it back to your application. You can change this behavior by taking direct control over the XML message processing with the IXmlSerializable.