SoapMessage.Stream Eigenschaft

Definition

Ruft die Daten ab, die die SOAP-Anforderung oder die SOAP-Antwort in Form eines Stream darstellen.

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

Eigenschaftswert

Eine schreibgeschützte Instanz der Stream-Klasse.

Beispiele

   // 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

Hinweise

SOAP-Erweiterungen, die die Daten überprüfen, die eine SOAP-Anforderung oder SOAP-Antwort darstellen, z. B. eine SOAP-Protokollierungserweiterung, können die Stream -Eigenschaft verwenden, um die Daten in jedem SoapMessageStageanzuzeigen.

SOAP-Erweiterungen, die die Daten ändern, die eine SOAP-Anforderung oder SOAP-Antwort darstellen, z. B. SOAP-Verschlüsselungs- oder Komprimierungs-SOAP-Erweiterungen, sollten dies mit der Stream an die ChainStream -Methode SoapExtensionübergebenen tun. Die Stream Eigenschaft von SoapMessage übergeben ist schreibgeschützt ProcessMessage .

Weitere Informationen zum Ändern der Daten, die eine SOAP-Anforderung oder SOAP-Antwort darstellen, finden Sie unter ChainStream.

Gilt für: