MessageEncoderFactory Class

 

An abstract base class that represents the factory for producing message encoders that can read messages from a stream and write them to a stream for various types of message encoding.

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

System.Object
  System.ServiceModel.Channels.MessageEncoderFactory

public abstract class MessageEncoderFactory

NameDescription
System_CAPS_protmethodMessageEncoderFactory()

Initializes a new instance of the MessageEncoderFactory class.

NameDescription
System_CAPS_pubpropertyEncoder

When overridden in a derived class, gets the message encoder that is produced by the factory.

System_CAPS_pubpropertyMessageVersion

When overridden in a derived class, gets the message version that is used by the encoders produced by the factory to encode messages.

NameDescription
System_CAPS_pubmethodCreateSessionEncoder()

Returns a message encoder that can be used to correlate messages in session-based exchanges.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

Encoding is the process of transforming a message into a sequence of bytes. Decoding is the reverse process.

Use this class if you want to implement a custom message encoder. To implement your own custom message encoder, you must provide custom implementations of the following three abstract base classes:

Override the Encoder to return an instance of your custom MessageEncoder. Then wire up your custom MessageEncoderFactory to the binding element stack used to configure the service or client by overriding the CreateMessageEncoderFactory method to return an instance of this factory. For more information about custom encoders, see Data Transfer and Serialization.

The following code shows how to write a class that is derived from MessageEncoderFactory:

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

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: