SoapAttributes.SoapEnum Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets an object that specifies how the XmlSerializer serializes a SOAP enumeration.

Namespace:   System.Xml.Serialization
Assembly:  System.Xml (in System.Xml.dll)

member SoapEnum : SoapEnumAttribute with get, set

Property Value

Type: System.Xml.Serialization.SoapEnumAttribute

An object that specifies how the XmlSerializer serializes an enumeration member.

The SoapEnumAttribute is used to control the serialization of an enumeration member. Set the SoapEnum property to a new SoapEnumAttribute to override the serialization of such a member.

For more information, see the SoapAttributeOverrides class overview.

The following example serializes two classes named Food and FoodType. The FoodType class contains two enumerations that are overridden, and for each enumeration, the example creates a SoapEnumAttribute that it assigns to the SoapEnum property of a SoapAttributes. The example then adds the SoapAttributes to a SoapAttributeOverrides, which is used to create an XmlSerializer.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top