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

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

SoapRpcServiceAttribute を使用すると、XML Web サービス内で、XML Web サービス メソッドの既定のエンコーディング スタイルとして、メソッドについては RPC エンコーディング、パラメータについては Encoded エンコーディングを設定できます。
Web サービス記述言語 (WSDL: Web Services Description Language) では、XML Web サービス メソッドまたは操作の SOAP 要求または SOAP 応答におけるエンコード方式として、RPC と Document の 2 つのスタイルを定義しています。RPC スタイルは、SOAP 仕様の RPC としての SOAP の使用に関する規定 (SOAP 仕様のセクション 7) に従って XML Web サービス メソッドをエンコーディングすることを示します。このスタイルは、XML Web サービス メソッドの名前が付いている単一の XML 要素内にすべてのパラメータをカプセル化し、その XML 要素内の各 XML 要素が各パラメータを表し、各要素にはそれぞれが表すパラメータの名前が付けられることを指定します。
既定のメソッド レベルのエンコーディングを Document に設定するには、SoapDocumentServiceAttribute を XML Web サービスを実装しているクラスに適用します。

SoapRpcServiceAttribute クラスを使用する方法の例を次に示します。
<%@ WebService Language="VB" Class="SumService" %> Imports System Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Web.Services.Description <SoapRpcServiceAttribute(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; [SoapRpcService(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.SoapRpcServiceAttribute


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


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