Defines a strongly typed class that corresponds to a SOAP message.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Thetype exposes the following members.
|Equals||Infrastructure. Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Returns the hash code for this instance. (Inherited from Attribute.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|Match||When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
Use the attribute to specify the structure of the SOAP envelope for a particular message. Your service can then use the message as a parameter or return type in service operations.
To implement a message contract for a type, annotate it with and annotate one or more of the class's fields or properties with MessageBodyMemberAttribute, MessageHeaderAttribute, or MessageHeaderArrayAttribute.
System.ServiceModel.MessageParameterAttribute is not a message contract attribute and cannot be used in conjunction with .
The following code example shows the use of the to control the SOAP envelope structure for both the request message and the response message, and the use of both the MessageHeaderAttribute (to create a SOAP header for the response message) and the MessageBodyMemberAttribute (to specify the bodies of both the request and response message). The code example contains an example of each message when sent.