SoapServices.GetTypeAndMethodNameFromSoapAction メソッド

定義

指定した SOAPAction 値と関連付けられたメソッドの型とメソッド名を確認します。

public:
 static bool GetTypeAndMethodNameFromSoapAction(System::String ^ soapAction, [Runtime::InteropServices::Out] System::String ^ % typeName, [Runtime::InteropServices::Out] System::String ^ % methodName);
public static bool GetTypeAndMethodNameFromSoapAction (string soapAction, out string typeName, out string methodName);
static member GetTypeAndMethodNameFromSoapAction : string * string * string -> bool
Public Shared Function GetTypeAndMethodNameFromSoapAction (soapAction As String, ByRef typeName As String, ByRef methodName As String) As Boolean

パラメーター

soapAction
String

型とメソッド名を要求したメソッドの SOAPAction。

typeName
String

このメソッドが返されるときに、要求したメソッドの型名を保持している String を格納します。 このパラメーターは初期化せずに渡されます。

methodName
String

このメソッドが返されるときに、要求したメソッドのメソッド名を保持している String を格納します。 このパラメーターは初期化せずに渡されます。

戻り値

型とメソッド名が正常に回復された場合は true。それ以外の場合は false

例外

SOAPAction 値が引用符で囲まれていません。

直前の呼び出し元に、インフラストラクチャ アクセス許可がありません。

このメソッドを使用する方法を次のコード例に示します。 このコード例は、SoapServices クラスのために提供されている大規模な例の一部です。

// Get the SOAP action for the method.
System::Reflection::MethodBase^ getHelloMethodBase =
   ExampleNamespace::ExampleClass::typeid->GetMethod( L"GetHello" );
String^ getHelloSoapAction =
   SoapServices::GetSoapActionFromMethodBase( getHelloMethodBase );
Console::WriteLine( L"The SOAP action for the method "
L"ExampleClass.GetHello is {0}.", getHelloSoapAction );
bool isSoapActionValid =
   SoapServices::IsSoapActionValidForMethodBase(
      getHelloSoapAction, getHelloMethodBase );
if ( isSoapActionValid )
{
   Console::WriteLine( L"The SOAP action, {0}, "
   L"is valid for ExampleClass.GetHello", getHelloSoapAction );
}
else
{
   Console::WriteLine( L"The SOAP action, {0}, "
   L"is not valid for ExampleClass.GetHello", getHelloSoapAction );
}

// Register the SOAP action for the GetHello method.
SoapServices::RegisterSoapActionForMethodBase( getHelloMethodBase );

// Get the type and the method names encoded into the SOAP action.
String^ encodedTypeName;
String^ encodedMethodName;
SoapServices::GetTypeAndMethodNameFromSoapAction(
   getHelloSoapAction,encodedTypeName,encodedMethodName );
Console::WriteLine( L"The type name encoded in this SOAP action is {0}.",
   encodedTypeName );
Console::WriteLine( L"The method name encoded in this SOAP action is {0}.",
   encodedMethodName );
// Get the SOAP action for the method.
System.Reflection.MethodBase getHelloMethodBase = 
    typeof(ExampleNamespace.ExampleClass).GetMethod("GetHello");
string getHelloSoapAction =
    SoapServices.GetSoapActionFromMethodBase(getHelloMethodBase);
Console.WriteLine(
    "The SOAP action for the method " +
    "ExampleClass.GetHello is {0}.", getHelloSoapAction);
bool isSoapActionValid = SoapServices.IsSoapActionValidForMethodBase(
    getHelloSoapAction,
    getHelloMethodBase);
if (isSoapActionValid)
{
    Console.WriteLine(
        "The SOAP action, {0}, " + 
        "is valid for ExampleClass.GetHello", 
        getHelloSoapAction);
}
else
{
    Console.WriteLine(
        "The SOAP action, {0}, " + 
        "is not valid for ExampleClass.GetHello", 
        getHelloSoapAction);
}

// Register the SOAP action for the GetHello method.
SoapServices.RegisterSoapActionForMethodBase(getHelloMethodBase);

// Get the type and the method names encoded into the SOAP action.
string encodedTypeName;
string encodedMethodName;
SoapServices.GetTypeAndMethodNameFromSoapAction(
    getHelloSoapAction, 
    out encodedTypeName, 
    out encodedMethodName);
Console.WriteLine(
    "The type name encoded in this SOAP action is {0}.",
    encodedTypeName);
Console.WriteLine(
    "The method name encoded in this SOAP action is {0}.",
    encodedMethodName);

注釈

true 型とメソッド名の参照が成功した場合は 。それ以外の場合は false

適用対象