Export (0) Print
Expand All

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.

System.Object
  System.ServiceModel.Channels.MessageEncoderFactory

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

public abstract class MessageEncoderFactory

The MessageEncoderFactory type exposes the following members.

  NameDescription
Protected methodSupported by Silverlight for Windows PhoneMessageEncoderFactoryInitializes a new instance of the MessageEncoderFactory class.
Top

  NameDescription
Public propertySupported by Silverlight for Windows PhoneEncoderWhen overridden in a derived class, gets the message encoder that is produced by the factory.
Public propertySupported by Silverlight for Windows PhoneMessageVersionWhen overridden in a derived class, gets the message version that is used by the encoders produced by the factory to encode messages.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneCreateSessionEncoderReturns a message encoder that can be used to correlate messages in session-based exchanges.
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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 Custom Encoders.

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

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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

Community Additions

ADD
Show:
© 2014 Microsoft