SoapDocumentServiceAttribute Classe
Definição
A aplicação do SoapDocumentServiceAttribute opcional para um serviço Web XML define o formato padrão das solicitações e respostas SOAP enviadas de e para métodos do serviço Web XML dentro do serviço Web XML.Applying the optional SoapDocumentServiceAttribute to an XML Web service sets the default format of SOAP requests and responses sent to and from XML Web service methods within the XML Web service.
public ref class SoapDocumentServiceAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class SoapDocumentServiceAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)]
public sealed class SoapDocumentServiceAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type SoapDocumentServiceAttribute = class
inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, Inherited=true)>]
type SoapDocumentServiceAttribute = class
inherit Attribute
Public NotInheritable Class SoapDocumentServiceAttribute
Inherits Attribute
- Herança
- Atributos
Exemplos
<%@ WebService Language="c#" Class="SumService" %>
using System;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Services.Description;
[SoapDocumentService(SoapBindingUse.Literal,
SoapParameterStyle.Wrapped,
RoutingStyle=SoapServiceRoutingStyle.SoapAction)]
public class SumService : System.Web.Services.WebService
{
[WebMethod]
public int Add(int a, int b)
{
return a + b;
}
}
<%@ WebService Language="VB" Class="SumService" %>
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Services.Description
<SoapDocumentService(SoapBindingUse.Literal, _
SoapParameterStyle.Wrapped, _
RoutingStyle := SoapServiceRoutingStyle.SoapAction)> _
Public Class SumService
Inherits System.Web.Services.WebService
<WebMethod> _
Public Function Add(a As Integer, b as Integer)
return a + b
End Function
End Class
Comentários
O SoapDocumentServiceAttribute permite que você defina os estilos de formatação padrão para métodos de serviço Web XML em um serviço Web XML.The SoapDocumentServiceAttribute allows you to set the default formatting styles for XML Web service methods within an XML Web service. Se um método de serviço Web XML individual precisar alterar esses padrões, aplique um SoapDocumentMethodAttribute a esse método de serviço Web XML.If an individual XML Web service method must change these defaults, apply a SoapDocumentMethodAttribute to that XML Web service method.
O WSDL (Web Services Description Language) define dois estilos de como um método de serviço Web XML, que chama uma operação, pode ser formatado em uma solicitação SOAP ou em uma resposta SOAP: RPC e Document .Web Services Description Language (WSDL) defines two styles for how an XML Web service method, which it calls an operation, can be formatted in a SOAP request or a SOAP response: RPC and Document. Exatamente como as partes de mensagem individuais são determinadas pelas Use ParameterStyle Propriedades e.Exactly how the individual message parts is determined by the Use and ParameterStyle properties. A Use propriedade determina se os parâmetros são formatados Encoded ou Literal .The Use property determines whether parameters are formatted Encoded or Literal. O ParameterStyle determina se os parâmetros são encapsulados dentro de uma única parte da mensagem abaixo do Body elemento ou se cada parâmetro é uma parte de mensagem individual.The ParameterStyle determines whether the parameters are encapsulated within a single message part beneath the Body element, or whether each parameter is an individual message part.
Para definir a formatação de nível de método padrão como RPC , aplique uma SoapRpcServiceAttribute à classe que implementa o Web Service XML.To set the default method level formatting to RPC, apply a SoapRpcServiceAttribute to the class implementing the XML Web service.
Para obter mais detalhes, consulte Personalizando a formatação de mensagens SOAP.For more details, see Customizing SOAP Message Formatting.
Esse atributo pode ser aplicado a uma classe que implementa um serviço Web XML.This attribute can be applied to a class implementing an XML Web service.
Construtores
| SoapDocumentServiceAttribute() |
Inicializa uma nova instância da classe SoapDocumentServiceAttribute, definindo todas as propriedades para os respectivos valores padrão.Initializes a new instance of the SoapDocumentServiceAttribute class setting all properties to their default values. |
| SoapDocumentServiceAttribute(SoapBindingUse) |
Inicializa uma nova instância da classe SoapDocumentServiceAttribute definindo a formatação de parâmetros.Initializes a new instance of the SoapDocumentServiceAttribute class setting the parameter formatting. |
| SoapDocumentServiceAttribute(SoapBindingUse, SoapParameterStyle) |
Inicializa uma nova instância da classe SoapDocumentServiceAttribute que define a formatação de parâmetros e define se os parâmetros são encapsulados em um único elemento XML, sob o elemento |
Propriedades
| ParameterStyle |
Obtém ou define a configuração padrão que controla se os parâmetros são encapsulados dentro de um único elemento seguindo o elemento |
| RoutingStyle |
Obtém ou define como as mensagens SOAP são roteadas para o serviço Web XML.Gets or sets how SOAP messages are routed to the XML Web service. |
| 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) |
| Use |
Obtém ou define a formatação de parâmetros padrão para um serviço Web XML.Gets or sets the default parameter formatting for an XML Web service. |
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) |
| 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) |