SoapServices.RegisterSoapActionForMethodBase Método

Definição

Associa um valor SOAPAction ao .MethodBase

Sobrecargas

Name Description
RegisterSoapActionForMethodBase(MethodBase)

Associa o especificado MethodBase ao SOAPAction armazenado em cache com ele.

RegisterSoapActionForMethodBase(MethodBase, String)

Associa o valor SOAPAction fornecido ao indicado MethodBase para uso em dissipadores de canais.

RegisterSoapActionForMethodBase(MethodBase)

Associa o especificado MethodBase ao SOAPAction armazenado em cache com ele.

public:
 static void RegisterSoapActionForMethodBase(System::Reflection::MethodBase ^ mb);
public static void RegisterSoapActionForMethodBase(System.Reflection.MethodBase mb);
[System.Security.SecurityCritical]
public static void RegisterSoapActionForMethodBase(System.Reflection.MethodBase mb);
static member RegisterSoapActionForMethodBase : System.Reflection.MethodBase -> unit
[<System.Security.SecurityCritical>]
static member RegisterSoapActionForMethodBase : System.Reflection.MethodBase -> unit
Public Shared Sub RegisterSoapActionForMethodBase (mb As MethodBase)

Parâmetros

mb
MethodBase

O MethodBase método para associar à SOAPAction armazenada em cache com ele.

Atributos

Exceções

O interlocutor imediato não tem autorização para infraestruturas.

Exemplos

O seguinte exemplo de código mostra como usar este método. Este exemplo de código faz parte de um exemplo maior fornecido para a SoapServices classe.

// Get the method base object for the GetHello method.
System::Reflection::MethodBase^ methodBase = 
  ExampleNamespace::ExampleClass::typeid->GetMethod( L"GetHello" );

// Print its current SOAP action.
Console::WriteLine( L"The SOAP action for the method "
   L"ExampleClass.GetHello is {0}.",
   SoapServices::GetSoapActionFromMethodBase( methodBase ) );

// Set the SOAP action of the GetHello method to a new value.
String^ newSoapAction = L"http://example.org/ExampleSoapAction#NewSoapAction";
SoapServices::RegisterSoapActionForMethodBase( methodBase, newSoapAction );
Console::WriteLine( L"The SOAP action for the method "
   L"ExampleClass.GetHello is {0}.",
   SoapServices::GetSoapActionFromMethodBase( methodBase ) );

// Reset the SOAP action of the GetHello method to its default
// value, which is determined using its SoapMethod attribute.
SoapServices::RegisterSoapActionForMethodBase( methodBase );
Console::WriteLine( L"The SOAP action for the method "
   L"ExampleClass.GetHello is {0}.",
   SoapServices::GetSoapActionFromMethodBase( methodBase ) );
// Get the method base object for the GetHello method.
System.Reflection.MethodBase methodBase = 
    typeof(ExampleNamespace.ExampleClass).GetMethod("GetHello");

// Print its current SOAP action.
Console.WriteLine(
    "The SOAP action for the method " +
    "ExampleClass.GetHello is {0}.",
    SoapServices.GetSoapActionFromMethodBase(methodBase));

// Set the SOAP action of the GetHello method to a new value.
string newSoapAction = 
    "http://example.org/ExampleSoapAction#NewSoapAction";
SoapServices.RegisterSoapActionForMethodBase(
    methodBase, newSoapAction);
Console.WriteLine(
    "The SOAP action for the method " +
    "ExampleClass.GetHello is {0}.",
    SoapServices.GetSoapActionFromMethodBase(methodBase));

// Reset the SOAP action of the GetHello method to its default
// value, which is determined using its SoapMethod attribute.
SoapServices.RegisterSoapActionForMethodBase(methodBase);
Console.WriteLine(
    "The SOAP action for the method " +
    "ExampleClass.GetHello is {0}.",
    SoapServices.GetSoapActionFromMethodBase(methodBase));

Observações

A SOAPAction do método especificado está contida na SoapMethodAttribute.SoapAction propriedade, ou é lida a partir do fio. O método atual associa a SOAPAction ao MethodBase para uso em pisoteis de canais.

O campo de cabeçalho do pedido HTTP SOAPAction indica a intenção do pedido HTTP SOAP. O valor é um URI que identifica a intenção. O SOAP não impõe restrições ao formato ou especificidade do URI, nem ao facto de ser resolvível. Um cliente HTTP deve usar este campo de cabeçalho ao emitir um pedido HTTP SOAP.

Aplica-se a

RegisterSoapActionForMethodBase(MethodBase, String)

Associa o valor SOAPAction fornecido ao indicado MethodBase para uso em dissipadores de canais.

public:
 static void RegisterSoapActionForMethodBase(System::Reflection::MethodBase ^ mb, System::String ^ soapAction);
public static void RegisterSoapActionForMethodBase(System.Reflection.MethodBase mb, string soapAction);
static member RegisterSoapActionForMethodBase : System.Reflection.MethodBase * string -> unit
Public Shared Sub RegisterSoapActionForMethodBase (mb As MethodBase, soapAction As String)

Parâmetros

mb
MethodBase

O MethodBase para associar à SOAPAction fornecida.

soapAction
String

O valor SOAPAction para associar ao dado MethodBase.

Exceções

O interlocutor imediato não tem autorização para infraestruturas.

Exemplos

O seguinte exemplo de código mostra como usar este método. Este exemplo de código faz parte de um exemplo maior fornecido para a SoapServices classe.

// Get the method base object for the GetHello method.
System::Reflection::MethodBase^ methodBase = 
  ExampleNamespace::ExampleClass::typeid->GetMethod( L"GetHello" );

// Print its current SOAP action.
Console::WriteLine( L"The SOAP action for the method "
   L"ExampleClass.GetHello is {0}.",
   SoapServices::GetSoapActionFromMethodBase( methodBase ) );

// Set the SOAP action of the GetHello method to a new value.
String^ newSoapAction = L"http://example.org/ExampleSoapAction#NewSoapAction";
SoapServices::RegisterSoapActionForMethodBase( methodBase, newSoapAction );
Console::WriteLine( L"The SOAP action for the method "
   L"ExampleClass.GetHello is {0}.",
   SoapServices::GetSoapActionFromMethodBase( methodBase ) );

// Reset the SOAP action of the GetHello method to its default
// value, which is determined using its SoapMethod attribute.
SoapServices::RegisterSoapActionForMethodBase( methodBase );
Console::WriteLine( L"The SOAP action for the method "
   L"ExampleClass.GetHello is {0}.",
   SoapServices::GetSoapActionFromMethodBase( methodBase ) );
// Get the method base object for the GetHello method.
System.Reflection.MethodBase methodBase = 
    typeof(ExampleNamespace.ExampleClass).GetMethod("GetHello");

// Print its current SOAP action.
Console.WriteLine(
    "The SOAP action for the method " +
    "ExampleClass.GetHello is {0}.",
    SoapServices.GetSoapActionFromMethodBase(methodBase));

// Set the SOAP action of the GetHello method to a new value.
string newSoapAction = 
    "http://example.org/ExampleSoapAction#NewSoapAction";
SoapServices.RegisterSoapActionForMethodBase(
    methodBase, newSoapAction);
Console.WriteLine(
    "The SOAP action for the method " +
    "ExampleClass.GetHello is {0}.",
    SoapServices.GetSoapActionFromMethodBase(methodBase));

// Reset the SOAP action of the GetHello method to its default
// value, which is determined using its SoapMethod attribute.
SoapServices.RegisterSoapActionForMethodBase(methodBase);
Console.WriteLine(
    "The SOAP action for the method " +
    "ExampleClass.GetHello is {0}.",
    SoapServices.GetSoapActionFromMethodBase(methodBase));

Observações

O campo de cabeçalho do pedido HTTP SOAPAction indica a intenção do pedido HTTP SOAP. O valor é um URI que identifica a intenção. O SOAP não impõe restrições ao formato ou especificidade do URI, nem ao facto de ser resolvível. Um cliente HTTP deve usar este campo de cabeçalho ao emitir um pedido HTTP SOAP.

Aplica-se a