Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MessageEncoder::WriteMessage Method (Message^, Stream^)

 

When overridden in a derived class, writes a message to a specified stream.

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public:
virtual void WriteMessage(
	Message^ message,
	Stream^ stream
) abstract

Parameters

message
Type: System.ServiceModel.Channels::Message^

The Message to write to the stream.

stream
Type: System.IO::Stream^

The Stream object to which the message is written.

NETCF

This method throws a NotSupportedException on the .NET Compact Framework.

The following code shows how to implement the WriteMessage(Message^, Stream^) method.

public override void WriteMessage(Message message, Stream stream)
{
    XmlWriter writer = XmlWriter.Create(stream, this.writerSettings);
    message.WriteMessage(writer);
    writer.Close();
}

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2017 Microsoft