Training
Certifications
Books
Special Offers
Community




 
Microsoft® .NET Framework 1.1 Class Library Reference Volumes 1-4: System
Author Microsoft Corporation
Pages 8000
Disk N/A
Level All Levels
Published 02/12/2003
ISBN 9780735615557
Price $149.99
To see this book's discounted price, select a reseller below.
 

More Information

About the Book
Table of Contents
Sample Chapter
Related Series
Related Books
About the Author

Support: Book & CD

Rate this book
Barnes Noble Amazon Quantum Books

 


System.Runtime.Remoting.Metadata Namespace



System.Runtime.Remoting.Metadata Namespace

The System.Runtime.Remoting.Metadata namespace contains classes and attributes that can be used to customize generation and processing of SOAP for objects and fields. The classes of this namespace can be used to indicate the SOAPAction header field, type output, XML element name, and the method XML namespace URI. This information is used by the SOAP serializer during SOAP generation and the Soapsuds tool during Web Services Description Language (WSDL) generation. The information specified by the attributes in this namespace can be used on the receiving end of the generated SOAP to customize processing of the remoted method calls and objects.

One of the most important classes of the System.Runtime.Remoting.Metadata namespace is SoapAttribute class. The SoapAttribute class is nonfunctional, and can only be used as the base class for all the metadata attributes.

For more information on the SOAPAction HTTP header field, see www.w3.org/tr/soap/#_Toc478383528.

SoapAttribute Class

Provides default functionality for all SOAP attributes.

System.Object
   System.Attribute
      System.Runtime.Remoting.Metadata.SoapAttribute
         System.Runtime.Remoting.Metadata.SoapFieldAttribute
         System.Runtime.Remoting.Metadata.SoapMethod
         Attribute
         System.Runtime.Remoting.Metadata.SoapParameter
         Attribute
         System.Runtime.Remoting.Metadata.SoapTypeAttribute

[Visual Basic]

Public Class SoapAttribute
   Inherits Attribute

[C#]

public class SoapAttribute : Attribute

[C++]

public __gc class SoapAttribute : public Attribute

[JScript]

public class SoapAttribute extends Attribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks

The SoapAttribute is nonfunctional, and can be used only as the base class for SOAP attributes.

Requirements

Namespace: System.Runtime.Remoting.Metadata

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: Mscorlib (in Mscorlib.dll)

SoapAttribute Constructor

Initializes a new instance of the SoapAttribute class.

[Visual Basic]

Public Sub New()

[C#]

public SoapAttribute();

[C++]

public: SoapAttribute();

[JScript]

public function SoapAttribute();

Remarks

The default constructor initializes any fields to their default values.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapAttribute.ProtXmlNamespace Field

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

[Visual Basic]

Protected ProtXmlNamespace As String

[C#]

protected string ProtXmlNamespace;

[C++]

protected: String* ProtXmlNamespace;

[JScript]

protected var ProtXmlNamespace : String;

SoapAttribute.ReflectInfo Field

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

[Visual Basic]

Protected ReflectInfo As Object

[C#]

protected object ReflectInfo;

[C++]

protected: Object* ReflectInfo;

[JScript]

protected var ReflectInfo : Object;

SoapAttribute.Embedded Property

Gets or sets a value indicating whether the type must be nested during SOAP serialization.

[Visual Basic]

Public Overridable Property Embedded As Boolean

[C#]

public virtual bool Embedded {get; set;}

[C++]

public: __property virtual bool get_Embedded();
public: __property virtual void set_Embedded(bool);

[JScript]

public function get Embedded() : Boolean;
public function set Embedded(Boolean);

Property Value

true if the target object must be nested during SOAP serialization; otherwise, false.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapAttribute.UseAttribute Property

Gets or sets a value indicating whether the target of the current attribute will be serialized as an XML attribute instead of an XML field.

[Visual Basic]

Public Overridable Property UseAttribute As Boolean

[C#]

public virtual bool UseAttribute {get; set;}

[C++]

public: __property virtual bool get_UseAttribute();
public: __property virtual void set_UseAttribute(bool);

[JScript]

public function get UseAttribute() : Boolean;
public function set UseAttribute(Boolean);

Property Value

true if the target object of the current attribute must be serialized as an XML attribute; false if the target object must be serialized as a subelement.

Remarks

For example, if a field FieldA of an object ObjectB is qualified with the SoapFieldAttribute(UseAttribute=true) attribute, FieldA will be serialized as <ObjectB><FieldA>5</FieldA></ObjectB>. If the UseAttribute property is set to false, FieldA will be serialized as <ObjectB FieldA="5"></ObjectB>.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapAttribute.XmlNamespace Property

Gets or sets the XML namespace name.

[Visual Basic]

Public Overridable Property XmlNamespace As String

[C#]

public virtual string XmlNamespace {get; set;}

[C++]

public: __property virtual String* get_XmlNamespace();
public: __property virtual void set_XmlNamespace(String*);

[JScript]

public function get XmlNamespace() : String;
public function set XmlNamespace(String);

Property Value

The XML namespace name under which the target of the current attribute is serialized.

Remarks

If the current property returns a null reference (Nothing in Visual Basic), then the namespace is not qualified.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapFieldAttribute Class

Customizes SOAP generation and processing for a field. This class cannot be inherited.

System.Object
   System.Attribute
      System.Runtime.Remoting.Metadata.SoapAttribute
         System.Runtime.Remoting.Metadata.SoapFieldAttribute

[Visual Basic]

<AttributeUsage(AttributeTargets.Field)>
NotInheritable Public Class SoapFieldAttribute
   Inherits SoapAttribute

[C#]

[AttributeUsage(AttributeTargets.Field)]
public sealed class SoapFieldAttribute : SoapAttribute

[C++]

[AttributeUsage(AttributeTargets::Field)]
public __gc __sealed class SoapFieldAttribute : public
   SoapAttribute

[JScript]

public
   AttributeUsage(AttributeTargets.Field)
class SoapFieldAttribute extends SoapAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks

The target objects for the SoapFieldAttribute attribute are object fields. The SoapFieldAttribute attribute is used to specify information that controls how the .NET Framework generates the SOAP XML wire format for target fields.

Example

[Visual Basic, C#, C++] The following code example demonstrates customization of SOAP generated for a field of a class with the SoapFieldAttribute. The SOAP can be produced by the code shown in the SerializableAttribute class example.

[Visual Basic]

<Serializable(), SoapTypeAttribute(XmlNamespace := "MyXmlNamespace")> Public Class TestSimpleObject
   Public member1 As Integer
   <SoapFieldAttribute(XmlElementName := "MyXmlElement")> Public member2 As String
   Public member3 As String
   Public member4 As Double
   ' A field that is not serialized.
   <NonSerialized()> Public member5 As String  
   Public Sub New()
      member1 = 11
      member2 = "hello"
      member3 = "hello"
      member4 = 3.14159265
      member5 = "hello world!"
   End Sub 'New
End Class 'TestSimpleObject
[C#]

[Serializable()] 
[SoapTypeAttribute(XmlNamespace="MyXmlNamespace")]
public class TestSimpleObject  {
    public int member1; 
    [SoapFieldAttribute(XmlElementName="MyXmlElement")] public string member2; 
    public string member3;
    public double member4; 
    // A field that is not serialized.
    [NonSerialized()] public string member5; 
    public TestSimpleObject() {
        member1 = 11;
        member2 = "hello";
        member3 = "hello";
        member4 = 3.14159265;
        member5 = "hello world!";
    }
}
[C++]

[Serializable] 
[SoapTypeAttribute(XmlNamespace=S"MyXmlNamespace")]
public __gc class TestSimpleObject 
{
public:
    int member1; 
    [SoapFieldAttribute(XmlElementName=S"MyXmlElement")]
    String* member2; 
    String* member3;
    double member4; 
    // A field that is not serialized.
    [NonSerialized]
    String* member5; 
public:
    TestSimpleObject() 
    {
        member1 = 11;
        member2 = S"hello";
        member3 = S"hello";
        member4 = 3.14159265;
        member5 = S"hello world!";
    }
};

Requirements

Namespace: System.Runtime.Remoting.Metadata

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: Mscorlib (in Mscorlib.dll)

SoapFieldAttribute Constructor

Initializes a new instance of the SoapFieldAttribute class.

[Visual Basic]

Public Sub New()

[C#]

public SoapFieldAttribute();

[C++]

public: SoapFieldAttribute();

[JScript]

public function SoapFieldAttribute();

Remarks

The default constructor initializes any fields to their default values.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapFieldAttribute.Order Property

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

[Visual Basic]

Public Property Order As Integer

[C#]

public int Order {get; set;}

[C++]

public: __property int get_Order();
public: __property void set_Order(int);

[JScript]

public function get Order() : int;
public function set Order(int);

SoapFieldAttribute.XmlElementName Property

Gets or sets the XML element name of the field contained in the SoapFieldAttribute attribute.

[Visual Basic]

Public Property XmlElementName As String

[C#]

public string XmlElementName {get; set;}

[C++]

public: __property String* get_XmlElementName();
public: __property void set_XmlElementName(String*);

[JScript]

public function get XmlElementName() : String;
public function set XmlElementName(String);

Property Value

The XML element name of the field contained in this attribute.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapFieldAttribute.IsInteropXmlElement Method

Returns a value indicating whether the current attribute contains interop XML element values.

[Visual Basic]

Public Function IsInteropXmlElement() As Boolean

[C#]

public bool IsInteropXmlElement();

[C++]

public: bool IsInteropXmlElement();

[JScript]

public function IsInteropXmlElement() : Boolean;

Return Value

true if the current attribute contains interop XML element values; otherwise, false.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapMethodAttribute Class

Customizes SOAP generation and processing for a method. This class cannot be inherited.

System.Object
   System.Attribute
      System.Runtime.Remoting.Metadata.SoapAttribute
         System.Runtime.Remoting.Metadata.SoapMethod
         Attribute

[Visual Basic]

<AttributeUsage(AttributeTargets.Method)>
NotInheritable Public Class SoapMethodAttribute
   Inherits SoapAttribute

[C#]

[AttributeUsage(AttributeTargets.Method)]
public sealed class SoapMethodAttribute : SoapAttribute

[C++]

[AttributeUsage(AttributeTargets::Method)]
public __gc __sealed class SoapMethodAttribute : public
   SoapAttribute

[JScript]

public
   AttributeUsage(AttributeTargets.Method)
class SoapMethodAttribute extends SoapAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks

The target objects for the SoapMethodAttribute attribute are methods that can be remotely invoked. Apply the SoapMethodAttribute to customize SOAP generation and processing. Properties of this attribute allow the programmer to customize the SOAPAction HTTP header field to indicate the intent of the SOAP HTTP request.

Requirements

Namespace: System.Runtime.Remoting.Metadata

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: Mscorlib (in Mscorlib.dll)

SoapMethodAttribute Constructor

Initializes a new instance of the SoapMethodAttribute class.

[Visual Basic]

Public Sub New()

[C#]

public SoapMethodAttribute();

[C++]

public: SoapMethodAttribute();

[JScript]

public function SoapMethodAttribute();

Remarks

The default constructor initializes any fields to their default values.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapMethodAttribute.ResponseXmlElementName Property

Gets or sets the XML element name to use for the method response to the target method.

[Visual Basic]

Public Property ResponseXmlElementName As String

[C#]

public string ResponseXmlElementName {get; set;}

[C++]

public: __property String* get_ResponseXmlElementName();
public: __property void set_ResponseXmlElementName(String*);

[JScript]

public function get ResponseXmlElementName() : String;
public function set ResponseXmlElementName(String);

Property Value

The XML element name to use for the method response to the target method.

Remarks

The default value of this property is the string "Response" appended to the name of the method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapMethodAttribute.ResponseXmlNamespace Property

Gets or sets the XML element namesapce used for method response to the target method.

[Visual Basic]

Public Property ResponseXmlNamespace As String

[C#]

public string ResponseXmlNamespace {get; set;}

[C++]

public: __property String* get_ResponseXmlNamespace();
public: __property void set_ResponseXmlNamespace(String*);

[JScript]

public function get ResponseXmlNamespace() : String;
public function set ResponseXmlNamespace(String);

Property Value

The XML element namesapce used for method response to the target method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapMethodAttribute.ReturnXmlElementName Property

Gets or sets the XML element name used for the return value from the target method.

[Visual Basic]

Public Property ReturnXmlElementName As String

[C#]

public string ReturnXmlElementName {get; set;}

[C++]

public: __property String* get_ReturnXmlElementName();
public: __property void set_ReturnXmlElementName(String*);

[JScript]

public function get ReturnXmlElementName() : String;
public function set ReturnXmlElementName(String);

Property Value

The XML element name used for the return value from the target method.

Remarks

The default value of this property is the "__return" string.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapMethodAttribute.SoapAction Property

Gets or sets the SOAPAction header field used with HTTP requests sent with this method.

[Visual Basic]

Public Property SoapAction As String

[C#]

public string SoapAction {get; set;}

[C++]

public: __property String* get_SoapAction();
public: __property void set_SoapAction(String*);

[JScript]

public function get SoapAction() : String;
public function set SoapAction(String);

Property Value

The SOAPAction header field used with HTTP requests sent with this method.

Remarks

The SOAPAction HTTP request header field indicates the intent of the SOAP HTTP request. For more information on the SOAPAction field, see www.w3.org/tr/soap/#_Toc478383528.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapMethodAttribute.UseAttribute Property

Gets or sets a value indicating whether the target of the current attribute will be serialized as an XML attribute instead of an XML field.

[Visual Basic]

Overrides Public Property UseAttribute As Boolean

[C#]

public override bool UseAttribute {get; set;}

[C++]

public: __property bool get_UseAttribute();
public: __property void set_UseAttribute(bool);

[JScript]

public override function get UseAttribute() : Boolean;
public override function set UseAttribute(Boolean);

Property Value

The current implementation always returns false.

Exceptions

Exception TypeCondition
RemotingExceptionAn attempt was made to set the current property.

Remarks

The UseAttribute property cannot be set on the SoapMethodAttribute attribute.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapMethodAttribute.XmlNamespace Property

Gets or sets the XML namespace that is used during serialization of remote method calls of the target method.

[Visual Basic]

Overrides Public Property XmlNamespace As String

[C#]

public override string XmlNamespace {get; set;}

[C++]

public: __property String* get_XmlNamespace();
public: __property void set_XmlNamespace(String*);

[JScript]

public override function get XmlNamespace() : String;
public override function set XmlNamespace(String);

Property Value

The XML namespace that is used during serialization of remote method calls of the target method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapOption Enumeration

Specifies the SOAP configuration options for use with the SoapTypeAttribute class.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

[Visual Basic]

<Flags>
<Serializable>
Public Enum SoapOption

[C#]

[Flags]
[Serializable]
public enum SoapOption

[C++]

[Flags]
[Serializable]
__value public enum SoapOption

[JScript]

public
   Flags
   Serializable
enum SoapOption

Remarks

The SoapOption enumeration is used to specify instructions to the .NET Framework on how it will generate the SOAP.

Members

Member nameDescriptionValue
AlwaysIncludeTypesIndicates that type will always be included on SOAP elements. This option is useful when performing SOAP interop with SOAP implementations that require types on all elements.1
EmbedAllIndicates that SOAP will be generated without references.4
NoneThe default option indicating that no extra options are selected.0
Option1This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.8
Option2This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.16
XsdStringIndicates that the output SOAP string type in a SOAP Envelope is using the XSD prefix, and that the resulting XML does not have an ID attribute for the string. For example, while a class by default might be remoted in the SOAP format as

<member1>10</member1>
<member2 id="ref-3">hello</member2>
<member3 href="#ref-3"/>
<member4 href="#ref-4"/>
<member4shared href="#ref-4"/>
<member5 href="#ref-5"/>
<member6 id="ref-6" xsi:type="SOAP-ENC:string">Hello World</member6>
<str1 id="ref-7">hello &#60; world</str1>
<str2 id="ref-8">&#60;</str2>
<str3 id="ref-9">&#60; world</str3>
<str4 href="#ref-7"/> remoting serialization with the XsdString option would produce the following XML. <member1 xsi:type="xsd:int">10</member1>
<member2 xsi:type="xsd:string">hello</member2>
<member3 xsi:type="xsd:string">hello</member3>
<member4 href="#ref-3"/>
<member4shared href="#ref-3"/>
<member5 href="#ref-4"/>
<member6 xsi:type="xsd:string">Hello World</member6>
<str1 xsi:type="xsd:string">hello &#60; world</str1>
<str2 xsi:type="xsd:string">&#60;</str2>
<str3 xsi:type="xsd:string">&#60; world</str3>
<str4 xsi:type="xsd:string">hello &#60; world</str4>

For more information about SOAP envelopes, see www.w3.org/tr/soap/#_Toc478383494.

2

Requirements

Namespace: System.Runtime.Remoting.Metadata

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: Mscorlib (in Mscorlib.dll)

SoapParameterAttribute Class

Customizes SOAP generation and processing for a parameter. This class cannot be inherited.

System.Object
   System.Attribute
      System.Runtime.Remoting.Metadata.SoapAttribute
         System.Runtime.Remoting.Metadata.SoapParameter
         Attribute

[Visual Basic]

<AttributeUsage(AttributeTargets.Parameter)>
NotInheritable Public Class SoapParameterAttribute
   Inherits SoapAttribute

[C#]

[AttributeUsage(AttributeTargets.Parameter)]
public sealed class SoapParameterAttribute : SoapAttribute

[C++]

[AttributeUsage(AttributeTargets::Parameter)]
public __gc __sealed class SoapParameterAttribute : public
   SoapAttribute

[JScript]

public
   AttributeUsage(AttributeTargets.Parameter)
class SoapParameterAttribute extends SoapAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks

The target objects for the SoapParameterAttribute attributes are parameters of method calls that are remotely invoked. The SoapParameterAttribute is used to specify information that controls how the .NET Framework generates the SOAP XML wire format for target parameters.

Requirements

Namespace: System.Runtime.Remoting.Metadata

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: Mscorlib (in Mscorlib.dll)

SoapParameterAttribute Constructor

Initializes a new instance of the SoapParameterAttribute class.

[Visual Basic]

Public Sub New()

[C#]

public SoapParameterAttribute();

[C++]

public: SoapParameterAttribute();

[JScript]

public function SoapParameterAttribute();

Remarks

The default constructor initializes any fields to their default values.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapTypeAttribute Class

Customizes SOAP generation and processing for target types. This class cannot be inherited.

System.Object
   System.Attribute
      System.Runtime.Remoting.Metadata.SoapAttribute
         System.Runtime.Remoting.Metadata.SoapTypeAttribute

[Visual Basic]

<AttributeUsage(AttributeTargets.Class Or AttributeTargets.Struct _
   Or AttributeTargets.Enum Or AttributeTargets.Interface)>
NotInheritable Public Class SoapTypeAttribute
   Inherits SoapAttribute

[C#]

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
   AttributeTargets.Enum | AttributeTargets.Interface)]
public sealed class SoapTypeAttribute : SoapAttribute

[C++]

[AttributeUsage(AttributeTargets::Class | AttributeTargets::Struct
   | AttributeTargets::Enum | AttributeTargets::Interface)]
public __gc __sealed class SoapTypeAttribute : public
   SoapAttribute

[JScript]

public

   AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
   AttributeTargets.Enum | AttributeTargets.Interface)
class SoapTypeAttribute extends SoapAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks

The SoapTypeAttribute attribute is a custom attribute that can be applied to objects, value types, and interface objects. This attribute is used to specify information on an object type that controls how SOAP will generate the SOAP XML wire format.

Example

[Visual Basic, C#, C++] The following code example demonstrates customization of SOAP generated for a class with the SoapTypeAttribute. The SOAP can be produced by the code shown in the SerializableAttribute class example.

[Visual Basic]

<Serializable(), SoapTypeAttribute(XmlNamespace := 
"MyXmlNamespace")> Public Class TestSimpleObject
   Public member1 As Integer
   <SoapFieldAttribute(XmlElementName := "MyXmlElement")> Public member2 As String
   Public member3 As String
   Public member4 As Double
   ' A field that is not serialized.
   <NonSerialized()> Public member5 As String  
   Public Sub New()
      member1 = 11
      member2 = "hello"
      member3 = "hello"
      member4 = 3.14159265
      member5 = "hello world!"
   End Sub 'New
End Class 'TestSimpleObject

[C#]

[Serializable()] 
[SoapTypeAttribute(XmlNamespace="MyXmlNamespace")]
public class TestSimpleObject  {
    public int member1; 
    [SoapFieldAttribute(XmlElementName="MyXmlElement")] public string member2; 
    public string member3;
    public double member4; 
    // A field that is not serialized.
    [NonSerialized()] public string member5; 
    public TestSimpleObject() {
        member1 = 11;
        member2 = "hello";
        member3 = "hello";
        member4 = 3.14159265;
        member5 = "hello world!";
    }
}

[C++]

[Serializable] 
[SoapTypeAttribute(XmlNamespace=S"MyXmlNamespace")]
public __gc class TestSimpleObject 
{
public:
    int member1; 
    [SoapFieldAttribute(XmlElementName=S"MyXmlElement")]
    String* member2; 
    String* member3;
    double member4; 
    // A field that is not serialized.
    [NonSerialized]
    String* member5; 
public:
    TestSimpleObject() 
    {
        member1 = 11;
        member2 = S"hello";
        member3 = S"hello";
        member4 = 3.14159265;
        member5 = S"hello world!";
    }
};

Requirements

Namespace: System.Runtime.Remoting.Metadata

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: Mscorlib (in Mscorlib.dll)

SoapTypeAttribute Constructor

Initializes a new instance of the SoapTypeAttribute class.

[Visual Basic]

Public Sub New()

[C#]

public SoapTypeAttribute();

[C++]

public: SoapTypeAttribute();

[JScript]

public function SoapTypeAttribute();

Remarks

The default constructor initializes any fields to their default values.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapTypeAttribute.SoapOptions Property

Gets or sets a SoapOption configuration value.

[Visual Basic]

Public Property SoapOptions As SoapOption

[C#]

public SoapOption SoapOptions {get; set;}

[C++]

public: __property SoapOption get_SoapOptions();
public: __property void set_SoapOptions(SoapOption);

[JScript]

public function get SoapOptions() : SoapOption;
public function set SoapOptions(SoapOption);

Property Value

A SoapOption value.

Remarks

A SoapOption value indicates the SOAP configuration options that will be used with a SoapTypeAttribute attribute.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapTypeAttribute.UseAttribute Property

Gets or sets a value indicating whether the target of the current attribute will be serialized as an XML attribute instead of an XML field.

[Visual Basic]

Overrides Public Property UseAttribute As Boolean

[C#]

public override bool UseAttribute {get; set;}

[C++]

public: __property bool get_UseAttribute();
public: __property void set_UseAttribute(bool);

[JScript]

public override function get UseAttribute() : Boolean;
public override function set UseAttribute(Boolean);

Property Value

The current implementation always returns false.

Exceptions

Exception TypeCondition
RemotingExceptionAn attempt was made to set the current property.

Remarks

The UseAttribute property cannot be set on the SoapTypeAttribute attribute.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapTypeAttribute.XmlElementName Property

Gets or sets the XML element name.

[Visual Basic]

Public Property XmlElementName As String

[C#]

public string XmlElementName {get; set;}

[C++]

public: __property String* get_XmlElementName();
public: __property void set_XmlElementName(String*);

[JScript]

public function get XmlElementName() : String;
public function set XmlElementName(String);

Property Value

The XML element name.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapTypeAttribute.XmlFieldOrder Property

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.

[Visual Basic]

Public Property XmlFieldOrder As XmlFieldOrderOption

[C#]

public XmlFieldOrderOption XmlFieldOrder {get; set;}

[C++]

public: __property XmlFieldOrderOption get_XmlFieldOrder();
public: __property void set_XmlFieldOrder(XmlFieldOrderOption);

[JScript]

public function get XmlFieldOrder() : XmlFieldOrderOption;
public function set XmlFieldOrder(XmlFieldOrderOption);

SoapTypeAttribute.XmlNamespace Property

Gets or sets the XML namespace that is used during serialization of the target object type.

[Visual Basic]

Overrides Public Property XmlNamespace As String

[C#]

public override string XmlNamespace {get; set;}

[C++]

public: __property String* get_XmlNamespace();
public: __property void set_XmlNamespace(String*);

[JScript]

public override function get XmlNamespace() : String;
public override function set XmlNamespace(String);

Property Value

The XML namespace that is used during serialization of the target object type.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapTypeAttribute.XmlTypeName Property

Gets or sets the XML type name for the target object type.

[Visual Basic]

Public Property XmlTypeName As String

[C#]

public string XmlTypeName {get; set;}

[C++]

public: __property String* get_XmlTypeName();
public: __property void set_XmlTypeName(String*);

[JScript]

public function get XmlTypeName() : String;
public function set XmlTypeName(String);

Property Value

The XML type name for the target object type.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

SoapTypeAttribute.XmlTypeNamespace Property

Gets or sets the XML type namespace for the current object type.

[Visual Basic]

Public Property XmlTypeNamespace As String

[C#]

public string XmlTypeNamespace {get; set;}

[C++]

public: __property String* get_XmlTypeNamespace();
public: __property void set_XmlTypeNamespace(String*);

[JScript]

public function get XmlTypeNamespace() : String;
public function set XmlTypeNamespace(String);

Property Value

The XML type namespace for the current object type.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

XmlFieldOrderOption Enumeration

This type supports the .NET Framework infrastructure and is not intended to be used directly from your code.

[Visual Basic]

<Serializable>
Public Enum XmlFieldOrderOption

[C#]

[Serializable]
public enum XmlFieldOrderOption

[C++]

[Serializable]
__value public enum XmlFieldOrderOption

[JScript]

public
   Serializable
enum XmlFieldOrderOption



Last Updated: January 13, 2003
Top of Page