Partager via


SoapMessage.Stream Propriété

Définition

Obtient des données représentant la demande ou la réponse SOAP sous la forme de Stream.

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

Valeur de propriété

Instance en lecture seule de la classe Stream.

Exemples

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

Remarques

Les extensions SOAP qui inspectent les données représentant une requête SOAP ou une réponse SOAP, telles qu’une extension SOAP de journalisation, peuvent utiliser la Stream propriété pour afficher les données à chaque SoapMessageStage.

Les extensions SOAP qui modifient les données représentant une requête SOAP ou une réponse SOAP, telles que des extensions SOAP de chiffrement ou de compression, doivent le faire avec le Stream passé à la ChainStream méthode de SoapExtension. La Stream propriété de SoapMessage passé dans est en ProcessMessage lecture seule.

Pour plus d’informations sur la modification des données représentant une requête SOAP ou une réponse SOAP, consultez ChainStream.

S’applique à