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

<AttributeUsageAttribute(AttributeTargets.Method)> _ Public NotInheritable Class SoapDocumentMethodAttribute Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Method)] public sealed class SoapDocumentMethodAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Method)] public ref class SoapDocumentMethodAttribute sealed : public Attribute

Web サービス記述言語 (WSDL: Web Services Description Language) では、操作を呼び出す XML Web サービス メソッドの SOAP メッセージ内における書式として、RPC と Document の 2 つのスタイルを定義しています。Document は、XSD スキーマに従った XML Web サービス メソッドの書式を指定します。Document スタイルは、Body 要素を、Body 要素の後に続く 1 つ以上の連続するメッセージ部分として書式指定することを表します。個別のメッセージ部分の詳細については、Use プロパティと ParameterStyle プロパティを使用して指定します。Use プロパティは、パラメータの書式として Encoded またはLiteral のいずれかを指定します。ParameterStyle は、パラメータを Body 要素の後に続く単一のメッセージ部分にカプセル化するかどうか、または各パラメータを独立したメッセージ部分とするかどうかを指定します。
詳細については、「SOAP メッセージ形式のカスタマイズ」を参照してください。
この属性は、サーバー上の XML Web サービス メソッドと、クライアント上のプロキシ クラスのメソッドの両方に適用できます。

GetUserName XML Web サービス メソッドに対して、メッセージ スタイルを Document に設定するコード例を次に示します。また、SOAP 要求と SOAP 応答の Body 要素に関連付けられている XML 要素として、それぞれ GetUserNameRequest と GetUserNameResponse が設定されています。
<%@ WebService Language="VB" class="MyUser" %> Imports System Imports System.Web.Services Imports System.Web.Services.Protocols Public Class MyUser Inherits WebService <SoapDocumentMethod(Action := "http://www.contoso.com/Sample", _ RequestNamespace := "http://www.contoso.com/Request", _ RequestElementName := "GetUserNameRequest", _ ResponseNamespace := "http://www.contoso.com/Response", _ ResponseElementName := "GetUserNameResponse"), _ WebMethod(Description := "Obtains the User Name")> _ Public Function GetUserName() As UserName Dim temp As String Dim pos As Integer Dim NewUser As New UserName() ' Get the full user name, including the domain name if applicable. temp = User.Identity.Name ' Deterime whether the user is part of a Domain by searching for a backslash. pos = temp.IndexOf("\") ' Parse the domain name out of the string, if one exists. If pos <= 0 Then NewUser.Name = User.Identity.Name Else NewUser.Name = temp.Remove(0, pos + 1) NewUser.Domain = temp.Remove(pos, temp.Length - pos) End If Return NewUser End Function End Class Public Class UserName Public Name As String Public Domain As String End Class
<%@ WebService Language="C#" class="MyUser" %> using System; using System.Web.Services; using System.Web.Services.Protocols; public class MyUser : WebService { [ SoapDocumentMethod(Action="http://www.contoso.com/Sample", RequestNamespace="http://www.contoso.com/Request" , RequestElementName="GetUserNameRequest", ResponseNamespace="http://www.contoso.com/Response" , ResponseElementName="GetUserNameResponse")] [ WebMethod(Description="Obtains the User Name") ] public UserName GetUserName() { string temp; int pos; UserName NewUser = new UserName(); // Get the full user name, including the domain name if applicable. temp = User.Identity.Name; // Deterime whether the user is part of a domain by searching for a backslash. pos = temp.IndexOf("\\"); // Parse the domain name out of the string, if one exists. if (pos <= 0) NewUser.Name = User.Identity.Name; else { NewUser.Name = temp.Remove(0,pos+1); NewUser.Domain = temp.Remove(pos,temp.Length-pos); } return NewUser; } } public class UserName { public string Name; public string Domain; }

System.Attribute
System.Web.Services.Protocols.SoapDocumentMethodAttribute


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


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


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


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


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


SoapDocumentMethodAttribute コンストラクタ

名前 | 説明 |
---|---|
SoapDocumentMethodAttribute () | SoapDocumentMethodAttribute クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
SoapDocumentMethodAttribute (String) | Action プロパティを action パラメータの値に設定して、SoapDocumentMethodAttribute クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |

SoapDocumentMethodAttribute プロパティ

名前 | 説明 | |
---|---|---|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。) |
![]() | Use | SOAP メッセージの XML 部分内にある XML Web サービス メソッドのパラメータの書式を取得または設定します。 |

SoapDocumentMethodAttribute メソッド

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

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

SoapDocumentMethodAttribute メンバ
SoapDocumentMethodAttribute をメソッドに適用することにより、そのメソッドとの間で送受信される SOAP メッセージに Document 書式を適用することを指定できます。
SoapDocumentMethodAttribute データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | TypeId | 派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。) |
![]() | Use | SOAP メッセージの XML 部分内にある XML Web サービス メソッドのパラメータの書式を取得または設定します。 |

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

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

- SoapDocumentMethodAttributeのページへのリンク