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

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

SoapDocumentServiceAttribute を使用すると、XML Web サービス内の XML Web サービス メソッドについて既定の書式スタイルを設定できます。この既定値を XML Web サービス メソッドごとに変更する必要がある場合は、SoapDocumentMethodAttribute を該当の XML Web サービス メソッドに適用します。
Web サービス記述言語 (WSDL: Web Services Description Language) では、操作を呼び出す XML Web サービス メソッドの SOAP 要求または SOAP 応答における書式として、RPC と Document の 2 つのスタイルを定義しています。個別のメッセージ部分の詳細については、Use プロパティと ParameterStyle プロパティを使用して指定します。Use プロパティは、パラメータの書式として Encoded またはLiteral のいずれかを指定します。ParameterStyle は、パラメータを Body 要素の下で単一のメッセージ部分にカプセル化するかどうか、または各パラメータを独立したメッセージ部分とするかどうかを指定します。
既定のメソッド レベルの書式を RPC に設定するには、SoapRpcServiceAttribute を XML Web サービスを実装しているクラスに適用します。

<%@ WebService Language="VB" Class="SumService" %> Imports System Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Web.Services.Description <SoapDocumentService(SoapBindingUse.Literal, _ SoapParameterStyle.Wrapped, _ RoutingStyle := SoapServiceRoutingStyle.SoapAction)> _ Public Class SumService Inherits System.Web.Services.WebService <WebMethod> _ Public Function Add(a As Integer, b as Integer) return a + b End Function End Class
<%@ WebService Language="c#" Class="SumService" %> using System; using System.Web.Services; using System.Web.Services.Protocols; using System.Web.Services.Description; [SoapDocumentService(SoapBindingUse.Literal, SoapParameterStyle.Wrapped, RoutingStyle=SoapServiceRoutingStyle.SoapAction)] public class SumService : System.Web.Services.WebService { [WebMethod] public int Add(int a, int b) { return a + b; } }

System.Attribute
System.Web.Services.Protocols.SoapDocumentServiceAttribute


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


- SoapDocumentServiceAttribute クラスのページへのリンク