XmlSerializerFormatAttribute Class
Assembly: System.ServiceModel (in system.servicemodel.dll)
'Declaration <AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Method Or AttributeTargets.Interface, Inherited:=False, AllowMultiple:=False)> _ Public NotInheritable Class XmlSerializerFormatAttribute Inherits Attribute 'Usage Dim instance As XmlSerializerFormatAttribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Interface, Inherited=false, AllowMultiple=false) */ public final class XmlSerializerFormatAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Method|AttributeTargets.Interface, Inherited=false, AllowMultiple=false) public final class XmlSerializerFormatAttribute extends Attribute
Not applicable.
This attribute is similar to the DataContractFormatAttribute attribute. Both attributes can be applied to either a method or a class.
For more information about the XmlSerializer, see Using the XmlSerializer.
A method can have either of the two attributes applied, but not both. Any operation that has neither applied will use the attribute applied to the containing class. If the containing class does not have either attribute applied, the DataContractSerializer is used.
Applying the attribute also causes a XmlSerializerOperationBehavior to be created at run time. The behavior allows customization at run time of the serializer behavior.
The following example applies the XmlSerializerFormatAttribute to an interface.
<ServiceContract(), XmlSerializerFormat(Style := OperationFormatStyle.Rpc, _ Use := OperationFormatUse.Encoded)> _ Public Interface ICalculator <OperationContract(), XmlSerializerFormat(Style := OperationFormatStyle.Rpc, _ Use := OperationFormatUse.Encoded)> _ Function Add(ByVal a As Double, ByVal b As Double) As Double End Interface
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.