System.Xml.Serialization.SoapAttributeAttribute Class

Specifies that the System.Xml.Serialization.XmlSerializer must serialize the class member as an encoded SOAP attribute.

See Also: SoapAttributeAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue | System.AttributeTargets.All)]
public class SoapAttributeAttribute : Attribute

Remarks

The System.Xml.Serialization.SoapAttributeAttribute class belongs to a family of attributes that controls how the System.Xml.Serialization.XmlSerializer serializes, or deserializes, an object as encoded SOAP XML. The resulting XML conforms to section 5 of the World Wide Web Consortium (www.w3.org) document, "Simple Object Access Protocol (SOAP) 1.1". For a complete list of similar attributes, see Attributes That Control Encoded SOAP Serialization.

To serialize an object as an encoded SOAP message, you must construct the System.Xml.Serialization.XmlSerializer using an System.Xml.Serialization.XmlTypeMapping created with the SoapReflectionImporter.ImportTypeMapping(Type) method of the System.Xml.Serialization.SoapReflectionImporter class.

Apply the System.Xml.Serialization.SoapAttributeAttribute to a public field to specify that the System.Xml.Serialization.XmlSerializer serializes the field as an XML attribute. You can specify an alternative name of the attribute by setting the SoapAttributeAttribute.AttributeName property. Set the SoapAttributeAttribute.DataType if the attribute must be given a specific XML Schema definition language (XSD) data type. If the attribute belongs to a specific XML namespace, set the SoapAttributeAttribute.Namespace property.

For more information about using attributes, see Extending Metadata Using Attributes

Note:

You can use the word SoapAttribute in your code instead of the longer System.Xml.Serialization.SoapAttributeAttribute.

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0