Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MessageVersion Property
Collapse the table of content
Expand the table of content

MessageEncodingBindingElement.MessageVersion Property

When overridden in a derived class, gets or sets the message version that can be handled by the message encoders produced by the message encoder factory.

Namespace:  System.ServiceModel.Channels
Assemblies:   System.ServiceModel (in System.ServiceModel.dll)
  System.ServiceModel.Primitives (in System.ServiceModel.Primitives.dll)

abstract MessageVersion : MessageVersion with get, set

Property Value

Type: System.ServiceModel.Channels.MessageVersion
The MessageVersion used by the encoders produced by the message encoder factory.

When binding elements are asked to process a message that has a MessageVersion not returned by this property, it should throw an exception.

The following code illustrates how to implement the MessageVersion property:

public override MessageVersion MessageVersion
{
    get
    {
        return this.msgVersion;
    }

    set
    {
        if (value == null)
            throw new ArgumentNullException("value");
        this.msgVersion = value;
    }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
Show:
© 2015 Microsoft