SoapTypeAttribute Klasa

Definicja

Dostosowuje generowanie i przetwarzanie protokołu SOAP dla typów docelowych. Klasa ta nie może być dziedziczona.

public ref class SoapTypeAttribute sealed : System::Runtime::Remoting::Metadata::SoapAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct)]
public sealed class SoapTypeAttribute : System.Runtime.Remoting.Metadata.SoapAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapTypeAttribute : System.Runtime.Remoting.Metadata.SoapAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct)>]
type SoapTypeAttribute = class
    inherit SoapAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapTypeAttribute = class
    inherit SoapAttribute
Public NotInheritable Class SoapTypeAttribute
Inherits SoapAttribute
Dziedziczenie
SoapTypeAttribute
Atrybuty

Przykłady

Poniższy przykład kodu przedstawia dostosowanie protokołu SOAP wygenerowanego dla klasy za pomocą klasy SoapTypeAttribute. Protokół SOAP można wygenerować za pomocą kodu pokazanego w przykładzie SerializableAttribute klasy.

[Serializable]
[SoapTypeAttribute(XmlNamespace="MyXmlNamespace")]
public ref class TestSimpleObject
{
public:
   int member1;

   [SoapFieldAttribute(XmlElementName="MyXmlElement")] String^ member2;

   String^ member3;
   double member4;

   // A field that is not serialized.

   [NonSerialized] String^ member5;

   TestSimpleObject()
   {
      member1 = 11;
      member2 = "hello";
      member3 = "hello";
      member4 = 3.14159265;
      member5 = "hello world!";
   }
};
[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!";
    }
}
<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

End Class

Uwagi

Atrybut SoapTypeAttribute jest atrybutem niestandardowym, który można zastosować do obiektów, typów wartości i obiektów interfejsu. Ten atrybut służy do określania informacji o typie obiektu, który kontroluje sposób generowania formatu przewodu SOAP XML.

Konstruktory

SoapTypeAttribute()

Tworzy wystąpienie klasy SoapTypeAttribute.

Pola

ProtXmlNamespace

Przestrzeń nazw XML, do której element docelowy bieżącego atrybutu SOAP jest serializowany.

(Odziedziczone po SoapAttribute)
ReflectInfo

Obiekt odbicia używany przez klasy atrybutów pochodzące z SoapAttribute klasy do ustawiania informacji o serializacji XML.

(Odziedziczone po SoapAttribute)

Właściwości

Embedded

Pobiera lub ustawia wartość wskazującą, czy typ musi być zagnieżdżony podczas serializacji protokołu SOAP.

(Odziedziczone po SoapAttribute)
SoapOptions

Pobiera lub ustawia SoapOption wartość konfiguracji.

TypeId

Po zaimplementowaniu w klasie pochodnej pobiera unikatowy identyfikator dla tego elementu Attribute.

(Odziedziczone po Attribute)
UseAttribute

Pobiera lub ustawia wartość wskazującą, czy element docelowy bieżącego atrybutu będzie serializowany jako atrybut XML zamiast pola XML.

XmlElementName

Pobiera lub ustawia nazwę elementu XML.

XmlFieldOrder

Pobiera lub ustawia kolejność pól XML dla typu obiektu docelowego.

XmlNamespace

Pobiera lub ustawia przestrzeń nazw XML używaną podczas serializacji typu obiektu docelowego.

XmlTypeName

Pobiera lub ustawia nazwę typu XML dla typu obiektu docelowego.

XmlTypeNamespace

Pobiera lub ustawia przestrzeń nazw typu XML dla bieżącego typu obiektu.

Metody

Equals(Object)

Zwraca wartość wskazującą, czy to wystąpienie jest równe podanemu obiektowi.

(Odziedziczone po Attribute)
GetHashCode()

Zwraca wartość skrótu dla tego wystąpienia.

(Odziedziczone po Attribute)
GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
IsDefaultAttribute()

W przypadku zastąpienia w klasie pochodnej wskazuje, czy wartość tego wystąpienia jest wartością domyślną klasy pochodnej.

(Odziedziczone po Attribute)
Match(Object)

W przypadku zastąpienia w klasie pochodnej zwraca wartość wskazującą, czy to wystąpienie jest równe określonemu obiektowi.

(Odziedziczone po Attribute)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Jawne implementacje interfejsu

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Zestaw nazw jest mapowany na odpowiedni zestaw identyfikatorów wysyłania.

(Odziedziczone po Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Pobiera informacje o typie obiektu, którego można użyć do pobrania informacji o typie interfejsu.

(Odziedziczone po Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Pobiera informację o liczbie typów interfejsów, jakie zawiera obiekt (0 lub 1).

(Odziedziczone po Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Umożliwia dostęp do właściwości i metod udostępnianych przez obiekt.

(Odziedziczone po Attribute)

Dotyczy