Compartir a través de


Cómo: Implementar el método ChainStream para guardar referencias en objetos de secuencia

El ejemplo siguiente muestra una implementación común del método ChainStream.

Ejemplo

    ' Save the Stream representing the SOAP request or SOAP response
    ' into a local memory buffer.
    Public Overrides Function ChainStream(stream As Stream) As 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
    End Function
    // 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;
    }

Consulte también

Tareas

Tutorial: Modificar el mensaje SOAP con extensiones SOAP

Copyright © 2007 Microsoft Corporation. Reservados todos los derechos.