This topic has not yet been rated - Rate this topic

ContextMessageProperty Class

A property used to communicate context between the application and channel layers on either the client or the service.

System.Object
  System.ServiceModel.Channels.ContextMessageProperty

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)
[SerializableAttribute]
public class ContextMessageProperty : IMessageProperty

The ContextMessageProperty type exposes the following members.

  Name Description
Public method ContextMessageProperty() Initializes a new instance of the ContextMessageProperty class.
Public method ContextMessageProperty(IDictionary<String, String>) Initializes a new instance of the ContextMessageProperty class with a specified context.
Top
  Name Description
Public property Context Gets the context used to correlate messages within a conversation between a client and a service.
Public property Static member Name Gets the name of the context message property.
Top
  Name Description
Public method AddOrReplaceInMessage Sets the value of the ContextMessageProperty property in a specified Message from the current instance of ContextMessageProperty.
Public method AddOrReplaceInMessageProperties Sets the value of the ContextMessageProperty property in a specified collection of MessageProperties from the current instance of ContextMessageProperty.
Public method CreateCopy Creates a copy of the current instance of ContextMessageProperty.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Static member TryCreateFromHttpCookieHeader Attempts to instantiate a ContextMessageProperty from the key/value pairs of a specified HTTP cookie.
Public method Static member TryGet(Message, ContextMessageProperty) Attempts to get the ContextMessageProperty from the properties of a specified message.
Public method Static member TryGet(MessageProperties, ContextMessageProperty) Attempts to get the ContextMessageProperty from a specified collection of message properties.
Top

A collection of properties that are added to a Message that correlates messages that form part of a conversation between a client and a service.

If Enabled is true, context is established at the channel layer, and all incoming messages on the client and the service have this context property attached by the context channel. If Enabled is false the ContextMessageProperty is used to attach context to an outgoing message on the client or the service at the application layer.

The ContextMessageProperty can be used on the client or on the service. Alternatively, on the client only, the current context can be obtained or a new context can be set on channel instance using GetContext and SetContext properties.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ