When overridden in a derived class, allows a SOAP extension access to the memory buffer containing the SOAP request or response.
Assembly: System.Web.Services (in System.Web.Services.dll)
Public Overridable Function ChainStream ( _ stream As Stream _ ) As Stream
public virtual Stream ChainStream( Stream stream )
public: virtual Stream^ ChainStream( Stream^ stream )
abstract ChainStream : stream:Stream -> Stream override ChainStream : stream:Stream -> Stream
Parameters
- stream
- Type: System.IO.Stream
A memory buffer containing the SOAP request or response.
Return Value
Type: System.IO.StreamA Stream representing a new memory buffer that this SOAP extension can modify.
ChainStream ensures that SOAP extensions with the highest priority can modify the actual data closest to the SOAP message sent or returned over the wire.
SOAP extensions should save references of the Stream passed into ChainStream and the Stream returned from ChainStream. If the SOAP extension is configured to run with a XML Web service method, the Stream passed into ChainStream contains the serialized SOAP request at the BeforeDeserialize SoapMessageStage. Similarily, the Stream reference returned from ChainStream is written into when the serialization occurs and thus contains the serialized SOAP response in the AfterSerialize SoapMessageStage.
The following example saves both the Stream passed into ChainStream and the Stream returned from ChainStream in the member variables oldStream and newStream, respectively.
Public Overrides Function ChainStream(stream As Stream) As Stream m_oldStream = stream m_newStream = New MemoryStream() Return m_newStream End Function
public override Stream ChainStream( Stream stream ){ oldStream = stream; newStream = new MemoryStream(); return newStream; }
public: virtual Stream^ ChainStream( Stream^ stream ) override { oldStream = stream; newStream = gcnew MemoryStream; return newStream; }
.NET Framework
Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0.NET Framework Client Profile
Supported in: 4, 3.5 SP1Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.