SoapMessage.Stream 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得以 Stream 形式表示的 SOAP 要求或 SOAP 回應的資料。
public:
property System::IO::Stream ^ Stream { System::IO::Stream ^ get(); };
public System.IO.Stream Stream { get; }
member this.Stream : System.IO.Stream
Public ReadOnly Property Stream As Stream
屬性值
Stream 類別的唯讀執行個體。
範例
// Write the contents of the incoming SOAP message to the log file.
public:
void WriteInputBeforeDeserialize( SoapMessage^ myMessage )
{
Copy( myOldStream, myNewStream );
FileStream^ myFileStream =
gcnew FileStream( myFileName, FileMode::Append, FileAccess::Write );
StreamWriter^ myStreamWriter = gcnew StreamWriter( myFileStream );
myStreamWriter->WriteLine(
"---------------------------------- Response at {0}", DateTime::Now );
Stream^ myStream = myMessage->Stream;
myStreamWriter->Write( "Length of data in the current response: " );
myStreamWriter->WriteLine( myStream->Length );
myStreamWriter->Flush();
myNewStream->Position = 0;
Copy( myNewStream, myFileStream );
myStreamWriter->Close();
myFileStream->Close();
myNewStream->Position = 0;
}
// Write the contents of the incoming SOAP message to the log file.
public void WriteInputBeforeDeserialize(SoapMessage myMessage)
{
Copy(myOldStream, myNewStream);
FileStream myFileStream =
new FileStream(myFileName, FileMode.Append, FileAccess.Write);
StreamWriter myStreamWriter = new StreamWriter(myFileStream);
myStreamWriter.WriteLine(
"---------------------------------- Response at " + DateTime.Now);
Stream myStream = myMessage.Stream;
myStreamWriter.Write("Length of data in the current response: ");
myStreamWriter.WriteLine(myStream.Length);
myStreamWriter.Flush();
myNewStream.Position = 0;
Copy(myNewStream, myFileStream);
myStreamWriter.Close();
myFileStream.Close();
myNewStream.Position = 0;
}
' Write the contents of the incoming SOAP message to the log file.
Public Sub WriteInputBeforeDeserialize(myMessage As SoapMessage)
Copy(myOldStream, myNewStream)
Dim myFileStream As _
New FileStream(myFileName, FileMode.Append, FileAccess.Write)
Dim myStreamWriter As New StreamWriter(myFileStream)
myStreamWriter.WriteLine( _
"---------------------------------- Response at " + DateTime.Now)
Dim myStream As Stream = myMessage.Stream
myStreamWriter.Write("Length of data in the current response: ")
myStreamWriter.WriteLine(myStream.Length)
myStreamWriter.Flush()
myNewStream.Position = 0
Copy(myNewStream, myFileStream)
myStreamWriter.Close()
myFileStream.Close()
myNewStream.Position = 0
End Sub
備註
檢查代表 SOAP 要求或 SOAP 回應之資料的 SOAP 延伸模組,例如記錄 SOAP 延伸模組,可以使用 Stream
屬性來檢視每個 SoapMessageStage 的資料。
修改代表 SOAP 要求或 SOAP 回應之資料的 SOAP 延伸模組,例如加密或壓縮 SOAP 延伸模組,應該使用 Stream 傳遞至 ChainStream 的 方法 SoapExtension 來執行此動作。 Stream傳入 ProcessMessage 的 SoapMessage 屬性是唯讀的。
如需修改代表 SOAP 要求或 SOAP 回應之資料的詳細資訊,請參閱 ChainStream 。