Export (0) Print
Expand All

Attributes That Control Encoded SOAP Serialization

The World Wide Web Consortium (www.w3.org) document named "Simple Object Access Protocol (SOAP) 1.1" contains an optional section (section 5) describing how SOAP parameters can be encoded. To conform to section 5 of the specification, you must use a special set of attributes found in the System.Xml.Serialization namespace. Apply those attributes as appropriate to classes and members of classes, and then use the XmlSerializer to serialize instances of the class or classes.

The following table lists the attributes, where they can be applied, and what they do. For more details about using these attributes to control XML serialization, see Generating SOAP Messages with XML Serialization.

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

Attribute Applies to Specifies
SoapAttributeAttribute Public field, property, parameter, or return value. The class member will be serialized as an XML attribute.
SoapElementAttribute Public field, property, parameter, or return value. The class will be serialized as an XML element.
SoapEnumAttribute Public field that is an enumeration identifier. The element name of an enumeration member.
SoapIgnoreAttribute Public properties and fields. The property or field should be ignored when the containing class is serialized.
SoapIncludeAttribute Public derived class declarations, and public methods for Web Services Description Language (WSDL) documents. The type should be included when generating schemas (to be recognized when serialized).
SoapTypeAttribute Public class declarations. The class should be serialized as an XML type.

See Also

XML and SOAP Serialization | Generating SOAP Messages with XML Serialization | Extending Metadata Using Attributes | XmlSerializer

© 2014 Microsoft