MessageEncodingBindingElement.CreateMessageEncoderFactory 方法

定义

在派生类中重写时,创建工厂以生成消息编码器。

public:
 abstract System::ServiceModel::Channels::MessageEncoderFactory ^ CreateMessageEncoderFactory();
public abstract System.ServiceModel.Channels.MessageEncoderFactory CreateMessageEncoderFactory ();
abstract member CreateMessageEncoderFactory : unit -> System.ServiceModel.Channels.MessageEncoderFactory
Public MustOverride Function CreateMessageEncoderFactory () As MessageEncoderFactory

返回

用于生成消息编码器的 MessageEncoderFactory

示例

下面的代码演示如何实现 CreateMessageEncoderFactory

public override MessageEncoderFactory CreateMessageEncoderFactory()
{
    return new CustomTextMessageEncoderFactory(this.MediaType,
        this.Encoding, this.MessageVersion);
}

适用于