SoapFieldAttribute Classe
Definição
Personaliza a geração de SOAP e processamento para um campo.Customizes SOAP generation and processing for a field. Essa classe não pode ser herdada.This class cannot be inherited.
public ref class SoapFieldAttribute sealed : System::Runtime::Remoting::Metadata::SoapAttribute
[System.AttributeUsage(System.AttributeTargets.Field)]
public sealed class SoapFieldAttribute : System.Runtime.Remoting.Metadata.SoapAttribute
[System.AttributeUsage(System.AttributeTargets.Field)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapFieldAttribute : System.Runtime.Remoting.Metadata.SoapAttribute
[<System.AttributeUsage(System.AttributeTargets.Field)>]
type SoapFieldAttribute = class
inherit SoapAttribute
[<System.AttributeUsage(System.AttributeTargets.Field)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapFieldAttribute = class
inherit SoapAttribute
Public NotInheritable Class SoapFieldAttribute
Inherits SoapAttribute
- Herança
- Atributos
Exemplos
O exemplo de código a seguir demonstra a personalização de SOAP gerada para um campo de uma classe com o SoapFieldAttribute .The following code example demonstrates customization of SOAP generated for a field of a class with the SoapFieldAttribute. O SOAP pode ser produzido pelo código mostrado no exemplo de SerializableAttribute classe.The SOAP can be produced by the code shown in the SerializableAttribute class example.
[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
Comentários
Os objetos de destino para o SoapFieldAttribute atributo são campos de objeto.The target objects for the SoapFieldAttribute attribute are object fields. O SoapFieldAttribute atributo é usado para especificar informações que controlam como o .NET Framework gera o formato de transmissão XML SOAP para campos de destino.The SoapFieldAttribute attribute is used to specify information that controls how the .NET Framework generates the SOAP XML wire format for target fields.
Construtores
| SoapFieldAttribute() |
Cria uma instância da classe SoapFieldAttribute.Creates an instance of SoapFieldAttribute class. |
Campos
| ProtXmlNamespace |
O namespace de XML para o qual o destino do atributo SOAP atual é serializado.The XML namespace to which the target of the current SOAP attribute is serialized. (Herdado de SoapAttribute) |
| ReflectInfo |
Um objeto de reflexão usado pelas classes de atributos derivados da classe SoapAttribute para definir as informações de serialização de XML.A reflection object used by attribute classes derived from the SoapAttribute class to set XML serialization information. (Herdado de SoapAttribute) |
Propriedades
| Embedded |
Obtém ou define um valor que indica se o tipo deve ser aninhado durante a serialização de SOAP.Gets or sets a value indicating whether the type must be nested during SOAP serialization. (Herdado de SoapAttribute) |
| Order |
Obtém ou define a ordem do atributo de campo atual.Gets or sets the order of the current field attribute. |
| TypeId |
Quando implementado em uma classe derivada, obtém um identificador exclusivo para este Attribute.When implemented in a derived class, gets a unique identifier for this Attribute. (Herdado de Attribute) |
| UseAttribute |
Obtém ou define um valor que indica se o destino do atributo atual será serializado como um atributo XML em vez de um campo XML.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. (Herdado de SoapAttribute) |
| XmlElementName |
Obtém ou define o nome do elemento XML do campo contido no atributo SoapFieldAttribute.Gets or sets the XML element name of the field contained in the SoapFieldAttribute attribute. |
| XmlNamespace |
Obtém ou define o nome do namespace de XML.Gets or sets the XML namespace name. (Herdado de SoapAttribute) |
Métodos
| Equals(Object) |
Retorna um valor que indica se essa instância é igual a um objeto especificado.Returns a value that indicates whether this instance is equal to a specified object. (Herdado de Attribute) |
| GetHashCode() |
Retorna o código hash para a instância.Returns the hash code for this instance. (Herdado de Attribute) |
| GetType() |
Obtém o Type da instância atual.Gets the Type of the current instance. (Herdado de Object) |
| IsDefaultAttribute() |
Quando substituído em uma classe derivada, indica se o valor dessa instância é o valor padrão para a classe derivada.When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Herdado de Attribute) |
| IsInteropXmlElement() |
Retorna um valor que indica se o atributo atual contém valores de elemento XML de interoperabilidade.Returns a value indicating whether the current attribute contains interop XML element values. |
| Match(Object) |
Quando substituído em uma classe derivada, retorna um valor que indica se essa instância é igual a um objeto especificado.When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Herdado de Attribute) |
| MemberwiseClone() |
Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object. (Herdado de Object) |
| ToString() |
Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object. (Herdado de Object) |
Implantações explícitas de interface
| _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapeia um conjunto de nomes para um conjunto correspondente de identificadores de expedição.Maps a set of names to a corresponding set of dispatch identifiers. (Herdado de Attribute) |
| _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera as informações de tipo para um objeto, que pode ser usado para obter as informações de tipo para uma interface.Retrieves the type information for an object, which can be used to get the type information for an interface. (Herdado de Attribute) |
| _Attribute.GetTypeInfoCount(UInt32) |
Retorna o número de interfaces de informações do tipo que um objeto fornece (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Herdado de Attribute) |
| _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornece acesso a propriedades e métodos expostos por um objeto.Provides access to properties and methods exposed by an object. (Herdado de Attribute) |