SoapServices.GetTypeAndMethodNameFromSoapAction メソッド
指定した SOAPAction 値と関連付けられたメソッドの型とメソッド名を確認します。
名前空間: System.Runtime.Remoting
アセンブリ: mscorlib (mscorlib.dll 内)
構文
Public Shared Function GetTypeAndMethodNameFromSoapAction ( _ soapAction As String, _ <OutAttribute> ByRef typeName As String, _ <OutAttribute> ByRef methodName As String _ ) As Boolean
Dim soapAction As String Dim typeName As String Dim methodName As String Dim returnValue As Boolean returnValue = SoapServices.GetTypeAndMethodNameFromSoapAction(soapAction, typeName, methodName)
public static bool GetTypeAndMethodNameFromSoapAction ( string soapAction, out string typeName, out string methodName )
public: static bool GetTypeAndMethodNameFromSoapAction ( String^ soapAction, [OutAttribute] String^% typeName, [OutAttribute] String^% methodName )



このメソッドを使用する方法を次のコード例に示します。このコード例は、SoapServices クラスのトピックで取り上げているコード例の一部分です。
// 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);
// 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 = ExampleNamespace. ExampleClass.class.ToType().GetMethod("GetHello"); String getHelloSoapAction = SoapServices. GetSoapActionFromMethodBase(getHelloMethodBase); Console.WriteLine("The SOAP action for the method " + "ExampleClass.GetHello is {0}.", getHelloSoapAction); boolean 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, encodedTypeName, 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);


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- SoapServices.GetTypeAndMethodNameFromSoapAction メソッドのページへのリンク