SoapServices.RegisterSoapActionForMethodBase Metodo

Definizione

Associa un valore SOAPAction all'oggetto MethodBase fornito.

Overload

RegisterSoapActionForMethodBase(MethodBase)

Associa l'oggetto MethodBase specificato al valore SOAPAction memorizzato nella cache con esso.

RegisterSoapActionForMethodBase(MethodBase, String)

Associa il valore SOAPAction fornito all'oggetto MethodBase dato per l'utilizzo nei sink di canale.

RegisterSoapActionForMethodBase(MethodBase)

Associa l'oggetto MethodBase specificato al valore SOAPAction memorizzato nella cache con esso.

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)

Parametri

mb
MethodBase

Oggetto MethodBase del metodo da associare al valore SOAPAction memorizzato nella cache con esso.

Attributi

Eccezioni

Il chiamante immediato non dispone dell'autorizzazione di infrastruttura.

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare questo metodo. Questo esempio di codice fa parte di un esempio più grande fornito per 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));

Commenti

LA SOAPAction del metodo specificato è contenuta nella SoapMethodAttribute.SoapAction proprietà oppure viene letto fuori dal filo. Il metodo corrente associa SOAPAction all'oggetto per l'uso MethodBase nei sink del canale.

Il campo intestazione della richiesta HTTP SOAPAction indica la finalità della richiesta HTTP SOAP. Il valore è un URI che identifica la finalità. SOAP non applica restrizioni al formato o alla specifica dell'URI o che è risolvibile. Un client HTTP deve usare questo campo di intestazione durante l'emissione di una richiesta HTTP SOAP.

Si applica a

RegisterSoapActionForMethodBase(MethodBase, String)

Associa il valore SOAPAction fornito all'oggetto MethodBase dato per l'utilizzo nei sink di canale.

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)

Parametri

mb
MethodBase

Oggetto MethodBase da associare al valore SOAPAction fornito.

soapAction
String

Valore SOAPAction da associare all'oggetto MethodBase dato.

Eccezioni

Il chiamante immediato non dispone dell'autorizzazione di infrastruttura.

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare questo metodo. Questo esempio di codice fa parte di un esempio più grande fornito per 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));

Commenti

Il campo intestazione della richiesta HTTP SOAPAction indica la finalità della richiesta HTTP SOAP. Il valore è un URI che identifica la finalità. SOAP non applica restrizioni al formato o alla specifica dell'URI o che è risolvibile. Un client HTTP deve usare questo campo di intestazione durante l'emissione di una richiesta HTTP SOAP.

Si applica a