This documentation is archived and is not being maintained.

How to: Implement the ChainStream Method to Save References to Stream Objects

Visual Studio 2010

This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation .

The following example shows a common implementation of the ChainStream method.

Example

    // Save the Stream representing the SOAP request or SOAP response into
    // a local memory buffer.
    public override Stream ChainStream( Stream stream ){
        // Save the passed in Stream in a member variable.
        oldStream = stream;

        // Create a new instance of a Stream and save that in a member
        // variable.
        newStream = new MemoryStream();
        return newStream;
    }

See Also

Show: