SoapMethodAttribute クラス
アセンブリ: mscorlib (mscorlib.dll 内)

<AttributeUsageAttribute(AttributeTargets.Method)> _ <ComVisibleAttribute(True)> _ Public NotInheritable Class SoapMethodAttribute Inherits SoapAttribute
[AttributeUsageAttribute(AttributeTargets.Method)] [ComVisibleAttribute(true)] public sealed class SoapMethodAttribute : SoapAttribute
[AttributeUsageAttribute(AttributeTargets::Method)] [ComVisibleAttribute(true)] public ref class SoapMethodAttribute sealed : public SoapAttribute

SoapMethodAttribute 属性のターゲット オブジェクトは、リモートから呼び出すことができるメソッドです。SOAP 生成および SOAP 処理をカスタマイズするために SoapMethodAttribute を適用します。この属性のプロパティを使用すると、プログラマは SOAPAction HTTP ヘッダー フィールドをカスタマイズして、SOAP HTTP 要求の意図を示すことができます。

SoapMethodAttribute クラスのメンバを使用して、メソッドの SOAP 生成と処理をカスタマイズする方法を次のコード例に示します。
using System; using System.Runtime.Remoting.Metadata; using System.Security.Permissions; namespace ExampleNamespace { public class ExampleClass { [SoapMethod( ResponseXmlElementName="ExampleResponseElement", ResponseXmlNamespace= "http://example.org/MethodResponseXmlNamespace" , ReturnXmlElementName="HelloMessage", SoapAction="http://example.org/ExampleSoapAction#GetHello" , XmlNamespace="http://example.org/MethodCallXmlNamespace")] public string GetHello(string name) { return "Hello, " + name; } } } public class Demo { [SecurityPermission(SecurityAction.Demand)] public static void Main(string[] args) { // Get the method info object for the GetHello method. System.Reflection.MethodBase getHelloMethod = typeof(ExampleNamespace.ExampleClass).GetMethod("GetHello"); // Print the XML namespace for the invocation of this method. string methodCallXmlNamespace = System.Runtime.Remoting.SoapServices. GetXmlNamespaceForMethodCall(getHelloMethod); Console.WriteLine( "The XML namespace for the response of the method " + "GetHello in ExampleClass is {0}.", methodCallXmlNamespace); // Print the XML namespace for the response of this method. string methodResponseXmlNamespace = System.Runtime.Remoting.SoapServices. GetXmlNamespaceForMethodResponse(getHelloMethod); Console.WriteLine( "The XML namespace for the invocation of the method " + "GetHello in ExampleClass is {0}.", methodResponseXmlNamespace); // Print the SOAP action for this method. string getHelloSoapAction = System.Runtime.Remoting.SoapServices. GetSoapActionFromMethodBase(getHelloMethod); Console.WriteLine( "The SOAP action for the method " + "GetHello in ExampleClass is {0}.", getHelloSoapAction); } }
#using <System.dll> #using <System.Runtime.Remoting.dll> using namespace System; using namespace System::Runtime::Remoting::Metadata; namespace ExampleNamespace { public ref class ExampleClass { public: [SoapMethod( ResponseXmlElementName="ExampleResponseElement", ResponseXmlNamespace= "http://example.org/MethodResponseXmlNamespace", ReturnXmlElementName="HelloMessage", SoapAction="http://example.org/ExampleSoapAction#GetHello" , XmlNamespace="http://example.org/MethodCallXmlNamespace")] String^ GetHello( String^ name ) { return String::Format( L"Hello, {0}", name ); } }; } int main() { // Get the method info object for the GetHello method. System::Reflection::MethodBase^ getHelloMethod = ExampleNamespace::ExampleClass::typeid->GetMethod( L"GetHello" ); // Print the XML namespace for the invocation of this method. String^ methodCallXmlNamespace = System::Runtime::Remoting::SoapServices::GetXmlNamespaceForMethodCall( getHelloMethod ); Console::WriteLine( L"The XML namespace for the response of the method " L"GetHello in ExampleClass is {0}.", methodCallXmlNamespace ); // Print the XML namespace for the response of this method. String^ methodResponseXmlNamespace = System::Runtime::Remoting::SoapServices::GetXmlNamespaceForMethodCall( getHelloMethod ); Console::WriteLine( L"The XML namespace for the invocation of the method " L"GetHello in ExampleClass is {0}.", methodResponseXmlNamespace ); // Print the SOAP action for this method. String^ getHelloSoapAction = System::Runtime::Remoting::SoapServices::GetXmlNamespaceForMethodCall( getHelloMethod ); Console::WriteLine( L"The SOAP action for the method " L"GetHello in ExampleClass is {0}.", getHelloSoapAction ); }

System.Attribute
System.Runtime.Remoting.Metadata.SoapAttribute
System.Runtime.Remoting.Metadata.SoapMethodAttribute


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapMethodAttribute コンストラクタ
アセンブリ: mscorlib (mscorlib.dll 内)


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SoapMethodAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() | Embedded | SOAP のシリアル化時に、型を入れ子にする必要があるかどうかを示す値を取得または設定します。 ( SoapAttribute から継承されます。) |
![]() | ResponseXmlElementName | ターゲット メソッドへのメソッドの応答に使用する XML 要素名を取得または設定します。 |
![]() | ResponseXmlNamespace | ターゲット メソッドへのメソッドの応答に使用する XML 要素の名前空間を取得または設定します。 |
![]() | ReturnXmlElementName | ターゲット メソッドからの戻り値に使用する XML 要素名を取得または設定します。 |
![]() | SoapAction | このメソッドで送信された HTTP 要求で使用する SOAPAction ヘッダー フィールドを取得または設定します。このプロパティは現在実装されていません。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
![]() | UseAttribute | オーバーライドされます。 現在の属性のターゲットを XML フィールドではなく XML 属性としてシリアル化するかどうかを示す値を取得または設定します。 |
![]() | XmlNamespace | オーバーライドされます。 ターゲット メソッドの、リモート メソッドの呼び出しのシリアル化中に使用する XML 名前空間を取得または設定します。 |

SoapMethodAttribute メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

SoapMethodAttribute メンバ
メソッドの SOAP 生成および SOAP 処理をカスタマイズします。このクラスは継承できません。
SoapMethodAttribute データ型で公開されるメンバを以下の表に示します。

名前 | 説明 | |
---|---|---|
![]() | SoapMethodAttribute |

名前 | 説明 | |
---|---|---|
![]() | Embedded | SOAP のシリアル化時に、型を入れ子にする必要があるかどうかを示す値を取得または設定します。(SoapAttribute から継承されます。) |
![]() | ResponseXmlElementName | ターゲット メソッドへのメソッドの応答に使用する XML 要素名を取得または設定します。 |
![]() | ResponseXmlNamespace | ターゲット メソッドへのメソッドの応答に使用する XML 要素の名前空間を取得または設定します。 |
![]() | ReturnXmlElementName | ターゲット メソッドからの戻り値に使用する XML 要素名を取得または設定します。 |
![]() | SoapAction | このメソッドで送信された HTTP 要求で使用する SOAPAction ヘッダー フィールドを取得または設定します。このプロパティは現在実装されていません。 |
![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
![]() | UseAttribute | オーバーライドされます。 現在の属性のターゲットを XML フィールドではなく XML 属性としてシリアル化するかどうかを示す値を取得または設定します。 |
![]() | XmlNamespace | オーバーライドされます。 ターゲット メソッドの、リモート メソッドの呼び出しのシリアル化中に使用する XML 名前空間を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 ( Attribute から継承されます。) |
![]() | GetCustomAttribute | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。) |
![]() | GetCustomAttributes | オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。) |
![]() | GetHashCode | このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | IsDefaultAttribute | 派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。) |
![]() | IsDefined | オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。) |
![]() | Match | 派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

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

- SoapMethodAttributeのページへのリンク