SoapServices.RegisterSoapActionForMethodBase Methode

Definitie

Koppelt een SOAPAction-waarde aan de opgegeven MethodBase.

Overloads

Name Description
RegisterSoapActionForMethodBase(MethodBase)

Hiermee koppelt u de opgegeven MethodBase waarde aan de SOAPAction in de cache.

RegisterSoapActionForMethodBase(MethodBase, String)

Koppelt de opgegeven SOAPAction-waarde aan de opgegeven MethodBase waarde voor gebruik in kanaalsinks.

RegisterSoapActionForMethodBase(MethodBase)

Hiermee koppelt u de opgegeven MethodBase waarde aan de SOAPAction in de cache.

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)

Parameters

mb
MethodBase

De MethodBase methode die moet worden gekoppeld aan de SOAPAction in de cache.

Kenmerken

Uitzonderingen

De directe beller heeft geen infrastructuurmachtiging.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u deze methode gebruikt. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de SoapServices klasse.

// 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));

Opmerkingen

De SOAPAction van de opgegeven methode bevindt zich in de SoapMethodAttribute.SoapAction eigenschap of wordt afgelezen door de kabel. De huidige methode koppelt de SOAPAction aan het MethodBase voor gebruik in kanaalsinks.

Het veld SOAPAction HTTP-aanvraagheader geeft de intentie van de SOAP HTTP-aanvraag aan. De waarde is een URI die de intentie identificeert. SOAP plaatst geen beperkingen voor de indeling of specificiteit van de URI of dat deze kan worden omgezet. Een HTTP-client moet dit headerveld gebruiken bij het uitgeven van een SOAP HTTP-aanvraag.

Van toepassing op

RegisterSoapActionForMethodBase(MethodBase, String)

Koppelt de opgegeven SOAPAction-waarde aan de opgegeven MethodBase waarde voor gebruik in kanaalsinks.

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)

Parameters

mb
MethodBase

De MethodBase te koppelen aan de opgegeven SOAPAction.

soapAction
String

De SOAPAction-waarde die moet worden gekoppeld aan de opgegeven MethodBasewaarde.

Uitzonderingen

De directe beller heeft geen infrastructuurmachtiging.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u deze methode gebruikt. Dit codevoorbeeld maakt deel uit van een groter voorbeeld voor de SoapServices klasse.

// 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));

Opmerkingen

Het veld SOAPAction HTTP-aanvraagheader geeft de intentie van de SOAP HTTP-aanvraag aan. De waarde is een URI die de intentie identificeert. SOAP plaatst geen beperkingen voor de indeling of specificiteit van de URI of dat deze kan worden omgezet. Een HTTP-client moet dit headerveld gebruiken bij het uitgeven van een SOAP HTTP-aanvraag.

Van toepassing op