LogicalMethodInfo クラス
アセンブリ: System.Web.Services (system.web.services.dll 内)


LogicalMethodInfo は主として SOAP 拡張機能で使用し、SOAP 拡張機能を実行するように設定した XML Web サービス メソッドの詳細を調査します。SOAP 拡張機能の設定により、LogicalMethodInfo を取り込む SoapExtension の GetInitializer メソッド内の XML Web サービス メソッドの詳細を調べます。LogicalMethodInfo は、Parameters プロパティ、および GetCustomAttributes プロパティを使用して XML Web サービス メソッドに適用されたカスタム属性にアクセスすることにより XML Web サービス メソッドのパラメータなどの詳細を提供します。
SOAP 拡張機能の詳細については SoapExtension クラスのトピックまたは「SOAP 拡張機能を使用した SOAP メッセージの変更」を参照してください。

' Process the SOAP message received and write to log file. Public Overrides Sub ProcessMessage(message As SoapMessage) Select Case message.Stage Case SoapMessageStage.BeforeSerialize Case SoapMessageStage.AfterSerialize WriteOutput(CType(message, SoapServerMessage)) Case SoapMessageStage.BeforeDeserialize WriteInput(CType(message, SoapServerMessage)) Case SoapMessageStage.AfterDeserialize Case Else Throw New Exception("invalid stage") End Select End Sub 'ProcessMessage ' Write the contents of the incoming SOAP message to the log file. Public Sub WriteInput(message As SoapServerMessage) ' Utility method to copy the contents of one stream to another. Copy(oldStream, newStream) Dim myFileStream As New FileStream(filename, FileMode.Append, FileAccess.Write) Dim myStreamWriter As New StreamWriter(myFileStream) myStreamWriter.WriteLine("================================== Request at " + _ DateTime.Now) myStreamWriter.WriteLine("The method that has been invoked is : ") myStreamWriter.WriteLine(ControlChars.Tab + message.MethodInfo.Name) myStreamWriter.WriteLine("The contents of the SOAP envelope are : ") myStreamWriter.Flush() newStream.Position = 0 Copy(newStream, myFileStream) myFileStream.Close() newStream.Position = 0 End Sub 'WriteInput ' Write the contents of the outgoing SOAP message to the log file. Public Sub WriteOutput(message As SoapServerMessage) newStream.Position = 0 Dim myFileStream As New FileStream(filename, FileMode.Append, FileAccess.Write) Dim myStreamWriter As New StreamWriter(myFileStream) myStreamWriter.WriteLine("---------------------------------- Response at " + _ DateTime.Now) myStreamWriter.Flush() ' Utility method to copy the contents of one stream to another. Copy(newStream, myFileStream) myFileStream.Close() newStream.Position = 0 Copy(newStream, oldStream) End Sub 'WriteOutput
// Process the SOAP message received and write to log file. public override void ProcessMessage(SoapMessage message) { switch (message.Stage) { case SoapMessageStage.BeforeSerialize: break; case SoapMessageStage.AfterSerialize: WriteOutput((SoapServerMessage)message); break; case SoapMessageStage.BeforeDeserialize: WriteInput((SoapServerMessage)message); break; case SoapMessageStage.AfterDeserialize: break; default: throw new Exception("invalid stage"); } } // Write the contents of the incoming SOAP message to the log file. public void WriteInput(SoapServerMessage message) { // Utility method to copy the contents of one stream to another. Copy(oldStream, newStream); FileStream myFileStream = new FileStream(filename, FileMode.Append, FileAccess.Write); StreamWriter myStreamWriter = new StreamWriter(myFileStream); myStreamWriter.WriteLine("================================== Request at " + DateTime.Now); myStreamWriter.WriteLine("The method that has been invoked is : "); myStreamWriter.WriteLine("\t" + message.MethodInfo.Name); myStreamWriter.WriteLine("The contents of the SOAP envelope are : "); myStreamWriter.Flush(); newStream.Position = 0; Copy(newStream, myFileStream); myFileStream.Close(); newStream.Position = 0; } // Write the contents of the outgoing SOAP message to the log file. public void WriteOutput(SoapServerMessage message) { newStream.Position = 0; FileStream myFileStream = new FileStream(filename, FileMode.Append, FileAccess.Write); StreamWriter myStreamWriter = new StreamWriter(myFileStream); myStreamWriter.WriteLine("---------------------------------- Response at " + DateTime.Now); myStreamWriter.Flush(); // Utility method to copy the contents of one stream to another. Copy(newStream, myFileStream); myFileStream.Close(); newStream.Position = 0; Copy(newStream, oldStream); }
// Process the SOAP message received and write to log file. public void ProcessMessage(SoapMessage message) throws Exception { switch(message.get_Stage()) { case SoapMessageStage.BeforeSerialize: break; case SoapMessageStage.AfterSerialize: WriteOutput((SoapServerMessage)message); break; case SoapMessageStage.BeforeDeserialize: WriteInput((SoapServerMessage)message); break; case SoapMessageStage.AfterDeserialize: break; default : throw new Exception("invalid stage"); } } //ProcessMessage // Write the contents of the incoming SOAP message to the log file. public void WriteInput(SoapServerMessage message) { // Utility method to copy the contents of one stream to another. Copy(oldStream, newStream); FileStream myFileStream = new FileStream(filename, FileMode.Append , FileAccess.Write); StreamWriter myStreamWriter = new StreamWriter(myFileStream); myStreamWriter.WriteLine("================================== " + "Request at " + DateTime.get_Now()); myStreamWriter.WriteLine("The method that has been invoked is : "); myStreamWriter.WriteLine("\t" + message.get_MethodInfo().get_Name()); myStreamWriter.WriteLine("The contents of the SOAP envelope are : "); myStreamWriter.Flush(); newStream.set_Position(0); Copy(newStream, myFileStream); myFileStream.Close(); newStream.set_Position(0); } //WriteInput // Write the contents of the outgoing SOAP message to the log file. public void WriteOutput(SoapServerMessage message) { newStream.set_Position(0); FileStream myFileStream = new FileStream(filename, FileMode.Append , FileAccess.Write); StreamWriter myStreamWriter = new StreamWriter(myFileStream); myStreamWriter.WriteLine("---------------------------------- " + "Response at " + DateTime.get_Now()); myStreamWriter.Flush(); // Utility method to copy the contents of one stream to another. Copy(newStream, myFileStream); myFileStream.Close(); newStream.set_Position(0); Copy(newStream, oldStream); } //WriteOutput

System.Web.Services.Protocols.LogicalMethodInfo


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


LogicalMethodInfo コンストラクタ
アセンブリ: System.Web.Services (system.web.services.dll 内)



Imports System Imports System.Reflection Imports System.Security.Permissions Imports System.Web.Services.Protocols Imports Microsoft.VisualBasic Public Class MyService Public Function Add(xValue As Integer, yValue As Integer) As Integer Return xValue + yValue End Function 'Add End Class 'MyService Class LogicalMethodInfo_Constructor <PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _ Shared Sub Run() Dim myType As Type = GetType(MyService) Dim myMethodInfo As MethodInfo = myType.GetMethod("Add") Dim myLogicalMethodInfo As New LogicalMethodInfo(myMethodInfo) Console.WriteLine(ControlChars.NewLine + "Printing properties of method : {0}" + _ ControlChars.NewLine, myLogicalMethodInfo.ToString()) Console.WriteLine(ControlChars.NewLine + "The declaring type of the method {0} is :" + _ ControlChars.NewLine, myLogicalMethodInfo.Name) Console.WriteLine(ControlChars.Tab + myLogicalMethodInfo.DeclaringType.ToString()) Console.WriteLine(ControlChars.NewLine + "The parameters of the method {0} are :" + _ ControlChars.NewLine, myLogicalMethodInfo.Name) Dim myParameters As ParameterInfo() = myLogicalMethodInfo.Parameters Dim i As Integer For i = 0 To myParameters.Length - 1 Console.WriteLine(ControlChars.Tab + myParameters(i).Name + " : " + _ myParameters(i).ParameterType.ToString()) Next i Console.WriteLine(ControlChars.NewLine + "The return type of the method {0} is :" + _ ControlChars.NewLine, myLogicalMethodInfo.Name) Console.WriteLine(ControlChars.Tab + myLogicalMethodInfo.ReturnType.ToString()) Dim service As New MyService() Console.WriteLine(ControlChars.NewLine + "Invoking the method {0}" + _ ControlChars.NewLine, myLogicalMethodInfo.Name) Console.WriteLine(ControlChars.Tab + "The sum of 10 and 10 is : {0}", _ myLogicalMethodInfo.Invoke(service, New Object() {10, 10})) End Sub 'Run Shared Sub Main() Run() End Sub 'Main End Class 'LogicalMethodInfo_Constructor
using System; using System.Reflection; using System.Security.Permissions; using System.Web.Services.Protocols; public class MyService { public int Add(int xValue, int yValue) { return (xValue + yValue); } } class LogicalMethodInfo_Constructor { [PermissionSetAttribute(SecurityAction.Demand, Name="FullTrust")] static void Run() { Type myType = typeof(MyService); MethodInfo myMethodInfo = myType.GetMethod("Add"); LogicalMethodInfo myLogicalMethodInfo = new LogicalMethodInfo(myMethodInfo); Console.WriteLine("\nPrinting properties of method : {0}\n", myLogicalMethodInfo.ToString()); Console.WriteLine("\nThe declaring type of the method {0} is :\n" , myLogicalMethodInfo.Name); Console.WriteLine("\t" + myLogicalMethodInfo.DeclaringType); Console.WriteLine("\nThe parameters of the method {0} are :\n", myLogicalMethodInfo.Name); ParameterInfo[] myParameters = myLogicalMethodInfo.Parameters; for(int i = 0; i < myParameters.Length; i++) { Console.WriteLine("\t" + myParameters[i].Name + " : " + myParameters[i].ParameterType); } Console.WriteLine("\nThe return type of the method {0} is :\n", myLogicalMethodInfo.Name); Console.WriteLine("\t" + myLogicalMethodInfo.ReturnType); MyService service = new MyService(); Console.WriteLine("\nInvoking the method {0}\n", myLogicalMethodInfo.Name); Console.WriteLine("\tThe sum of 10 and 10 is : {0}", myLogicalMethodInfo.Invoke(service, new object[] {10, 10})); } static void Main() { Run(); } }
#using <System.Web.Services.dll> using namespace System; using namespace System::Reflection; using namespace System::Web::Services::Protocols; public ref class MyService { public: int Add( int xValue, int yValue ) { return (xValue + yValue); } }; int main() { Type^ myType = MyService::typeid; MethodInfo^ myMethodInfo = myType->GetMethod( "Add" ); LogicalMethodInfo^ myLogicalMethodInfo = gcnew LogicalMethodInfo( myMethodInfo ); Console::WriteLine( "\nPrinting properties of method : {0}\n", myLogicalMethodInfo ); Console::WriteLine( "\nThe declaring type of the method {0} is :\n", myLogicalMethodInfo->Name ); Console::WriteLine( "\t {0}", myLogicalMethodInfo->DeclaringType ); Console::WriteLine( "\nThe parameters of the method {0} are :\n", myLogicalMethodInfo->Name ); array<ParameterInfo^>^myParameters = myLogicalMethodInfo->Parameters; for ( int i = 0; i < myParameters->Length; i++ ) { Console::WriteLine( "\t {0}", String::Concat( myParameters[ i ]->Name, " : ", myParameters[ i ]->ParameterType ) ); } Console::WriteLine( "\nThe return type of the method {0} is :\n", myLogicalMethodInfo->Name ); Console::WriteLine( "\t {0}", myLogicalMethodInfo->ReturnType ); MyService^ service = gcnew MyService; Console::WriteLine( "\nInvoking the method {0}\n", myLogicalMethodInfo->Name ); array<Object^>^values = gcnew array<Object^>(2); values[ 0 ] = 10; values[ 1 ] = 10; Console::WriteLine( "\tThe sum of 10 and 10 is : {0}", myLogicalMethodInfo->Invoke( service, values ) ); }

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


LogicalMethodInfo プロパティ
LogicalMethodInfo メソッド

名前 | 説明 | |
---|---|---|
![]() | BeginInvoke | この LogicalMethodInfo で表されるメソッドの非同期呼び出しを開始します。 |
![]() | Create | オーバーロードされます。 指定された MethodInfo の配列に基づいて LogicalMethodInfo の配列を作成します。 |
![]() | EndInvoke | 現在の LogicalMethodInfo で表されているメソッドの非同期呼び出しを終了します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetCustomAttribute | カスタム属性がこの型に適用されている場合は、最初に適用されたカスタム属性を返します。 |
![]() | GetCustomAttributes | 指定された型に適用されるカスタム属性を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | Invoke | 現在の LogicalMethodInfo が表すメソッドを呼び出します。 |
![]() | IsBeginMethod | 渡されたメソッドが非同期呼び出しの Begin メソッドを表しているかどうかを示す値を返します。 |
![]() | IsEndMethod | 渡されたメソッドが非同期呼び出しの End メソッドを表しているかどうかを示す値を返します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーライドされます。 現在の LogicalMethodInfo を表す文字列を返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

LogicalMethodInfo メンバ
XML Web サービス メソッドの属性とメタデータを表します。このクラスは継承できません。
LogicalMethodInfo データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | BeginInvoke | この LogicalMethodInfo で表されるメソッドの非同期呼び出しを開始します。 |
![]() | Create | オーバーロードされます。 指定された MethodInfo の配列に基づいて LogicalMethodInfo の配列を作成します。 |
![]() | EndInvoke | 現在の LogicalMethodInfo で表されているメソッドの非同期呼び出しを終了します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetCustomAttribute | カスタム属性がこの型に適用されている場合は、最初に適用されたカスタム属性を返します。 |
![]() | GetCustomAttributes | 指定された型に適用されるカスタム属性を返します。 |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | Invoke | 現在の LogicalMethodInfo が表すメソッドを呼び出します。 |
![]() | IsBeginMethod | 渡されたメソッドが非同期呼び出しの Begin メソッドを表しているかどうかを示す値を返します。 |
![]() | IsEndMethod | 渡されたメソッドが非同期呼び出しの End メソッドを表しているかどうかを示す値を返します。 |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーライドされます。 現在の LogicalMethodInfo を表す文字列を返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

Weblioに収録されているすべての辞書からLogicalMethodInfoを検索する場合は、下記のリンクをクリックしてください。

- LogicalMethodInfoのページへのリンク