Partager via


SoapServices.RegisterSoapActionForMethodBase Méthode

Définition

Associe une valeur SOAPAction au fichier fourni MethodBase.

Surcharges

Nom Description
RegisterSoapActionForMethodBase(MethodBase)

Associe le soapAction spécifié MethodBase mis en cache à celui-ci.

RegisterSoapActionForMethodBase(MethodBase, String)

Associe la valeur SOAPAction fournie à l’utilisation donnée MethodBase dans les récepteurs de canal.

RegisterSoapActionForMethodBase(MethodBase)

Associe le soapAction spécifié MethodBase mis en cache à celui-ci.

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)

Paramètres

mb
MethodBase

Méthode MethodBase à associer à SOAPAction mise en cache avec elle.

Attributs

Exceptions

L’appelant immédiat n’a pas d’autorisation d’infrastructure.

Exemples

L’exemple de code suivant montre comment utiliser cette méthode. Cet exemple de code fait partie d’un exemple plus grand fourni pour la 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));

Remarques

L’action SOAPAction de la méthode spécifiée est contenue dans la SoapMethodAttribute.SoapAction propriété ou est lue sur le fil. La méthode actuelle associe SOAPAction à l’utilisation MethodBase dans les récepteurs de canal.

Le champ d’en-tête de requête HTTP SOAPAction indique l’intention de la requête HTTP SOAP. La valeur est un URI identifiant l’intention. SOAP n’impose aucune restriction au format ou à la spécificité de l’URI ou qu’il est résolu. Un client HTTP doit utiliser ce champ d’en-tête lors de l’émission d’une requête HTTP SOAP.

S’applique à

RegisterSoapActionForMethodBase(MethodBase, String)

Associe la valeur SOAPAction fournie à l’utilisation donnée MethodBase dans les récepteurs de canal.

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)

Paramètres

mb
MethodBase

À MethodBase associer à l’action SOAPAction fournie.

soapAction
String

Valeur SOAPAction à associer à l’élément donné MethodBase.

Exceptions

L’appelant immédiat n’a pas d’autorisation d’infrastructure.

Exemples

L’exemple de code suivant montre comment utiliser cette méthode. Cet exemple de code fait partie d’un exemple plus grand fourni pour la 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));

Remarques

Le champ d’en-tête de requête HTTP SOAPAction indique l’intention de la requête HTTP SOAP. La valeur est un URI identifiant l’intention. SOAP n’impose aucune restriction au format ou à la spécificité de l’URI ou qu’il est résolu. Un client HTTP doit utiliser ce champ d’en-tête lors de l’émission d’une requête HTTP SOAP.

S’applique à