MessagePropertyAttribute Class

Represents data that is passed locally with a custom message type but not serialized into a SOAP message.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

'Declaration
<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Field, Inherited:=False)> _
Public NotInheritable Class MessagePropertyAttribute
	Inherits Attribute
'Usage
Dim instance As MessagePropertyAttribute

/** @attribute AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, Inherited=false) */ 
public final class MessagePropertyAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Field, Inherited=false) 
public final class MessagePropertyAttribute extends Attribute
Not applicable.

Use the MessagePropertyAttribute attribute to attach data to the custom message type as it passes through the Windows Communication Foundation (WCF) system without serializing the data into a SOAP message.

The following code example demonstrates the use of the MessagePropertyAttribute attribute.

[MessageContractAttribute] 
public class CustomMessage 
{ 
    private Person internalPerson; 
    [MessageProperty] 
    private int a = 23; 
    [MessageBodyMember(Name="Person")] 
    public PersonType Data 
    { 
        get 
        { 
            return internalPerson; 
        } 
        set
        { 
            this.internalPerson = (Person)value; 
        } 
    } 
}

System.Object
   System.Attribute
    System.ServiceModel.MessagePropertyAttribute

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show: