Aracılığıyla paylaş


SoapServices.RegisterSoapActionForMethodBase Yöntem

Tanım

SoapAction değerini sağlanan ile ilişkilendirir MethodBase.

Aşırı Yüklemeler

RegisterSoapActionForMethodBase(MethodBase)

Belirtilen MethodBase öğesini kendisiyle önbelleğe alınan SOAPAction ile ilişkilendirir.

RegisterSoapActionForMethodBase(MethodBase, String)

Sağlanan SOAPAction değerini, kanal havuzlarında kullanılmak üzere verilen MethodBase ile ilişkilendirir.

RegisterSoapActionForMethodBase(MethodBase)

Belirtilen MethodBase öğesini kendisiyle önbelleğe alınan SOAPAction ile ilişkilendirir.

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)

Parametreler

mb
MethodBase

MethodBase Kendisiyle önbelleğe alınan SOAPAction ile ilişkilendirme yönteminin.

Öznitelikler

Özel durumlar

Hemen çağıranın altyapı izni yok.

Örnekler

Aşağıdaki kod örneğinde bu yöntemin nasıl kullanılacağı gösterilmektedir. Bu kod örneği, sınıfı için SoapServices sağlanan daha büyük bir örneğin parçasıdır.

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

Açıklamalar

Belirtilen yöntemin SOAPAction özelliğinde SoapMethodAttribute.SoapAction yer alır veya telden okunur. Geçerli yöntem, SOAPAction'ı kanal havuzlarında kullanmak üzere ile MethodBase ilişkilendirir.

SOAPAction HTTP isteği üst bilgisi alanı, SOAP HTTP isteğinin amacını gösterir. değeri, amacı tanımlayan bir URI'dir. SOAP, URI'nin biçimine veya özgüllüğüne veya çözümlenebilir olduğuna ilişkin hiçbir kısıtlama getirmez. BIR HTTP istemcisi, SOAP HTTP isteği oluştururken bu üst bilgi alanını kullanmalıdır.

Şunlara uygulanır

RegisterSoapActionForMethodBase(MethodBase, String)

Sağlanan SOAPAction değerini, kanal havuzlarında kullanılmak üzere verilen MethodBase ile ilişkilendirir.

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)

Parametreler

mb
MethodBase

MethodBase sağlanan SOAPAction ile ilişkilendirmek için.

soapAction
String

Verilen MethodBaseile ilişkilendirilecek SOAPAction değeri.

Özel durumlar

Hemen çağıranın altyapı izni yok.

Örnekler

Aşağıdaki kod örneğinde bu yöntemin nasıl kullanılacağı gösterilmektedir. Bu kod örneği, sınıfı için SoapServices sağlanan daha büyük bir örneğin parçasıdır.

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

Açıklamalar

SOAPAction HTTP isteği üst bilgisi alanı, SOAP HTTP isteğinin amacını gösterir. değeri, amacı tanımlayan bir URI'dir. SOAP, URI'nin biçimine veya özgüllüğüne veya çözümlenebilir olduğuna ilişkin hiçbir kısıtlama getirmez. BIR HTTP istemcisi, SOAP HTTP isteği oluştururken bu üst bilgi alanını kullanmalıdır.

Şunlara uygulanır