次の方法で共有


SoapDocumentServiceAttribute コンストラクタ (SoapBindingUse, SoapParameterStyle)

パラメータの書式を指定し、SOAP メッセージ内の Body 要素の下で単一の XML 要素内にパラメータをカプセル化するかどうかを指定する SoapDocumentServiceAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.Web.Services.Protocols
アセンブリ: System.Web.Services (system.web.services.dll 内)

構文

'宣言
Public Sub New ( _
    use As SoapBindingUse, _
    paramStyle As SoapParameterStyle _
)
'使用
Dim use As SoapBindingUse
Dim paramStyle As SoapParameterStyle

Dim instance As New SoapDocumentServiceAttribute(use, paramStyle)
public SoapDocumentServiceAttribute (
    SoapBindingUse use,
    SoapParameterStyle paramStyle
)
public:
SoapDocumentServiceAttribute (
    SoapBindingUse use, 
    SoapParameterStyle paramStyle
)
public SoapDocumentServiceAttribute (
    SoapBindingUse use, 
    SoapParameterStyle paramStyle
)
public function SoapDocumentServiceAttribute (
    use : SoapBindingUse, 
    paramStyle : SoapParameterStyle
)
適用できません。

パラメータ

  • use
    パラメータの書式スタイル。Use プロパティを設定します。
  • paramStyle
    XML Web サービス内の XML Web サービス メソッドとの間で送受信される SOAP メッセージで、Body 要素の下にある単一の XML 要素内にパラメータをカプセル化するかどうかを設定します。ParameterStyle プロパティを設定します。

使用例

<%@ 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)> _
    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)]
    public class SumService : System.Web.Services.WebService
    {
        [WebMethod]
        public int Add(int a, int b)
        {
            return a + b;
        }
    }

プラットフォーム

Windows 98,Windows Server 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

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

.NET Compact Framework

サポート対象 : 2.0,1.0

参照

関連項目

SoapDocumentServiceAttribute クラス
SoapDocumentServiceAttribute メンバ
System.Web.Services.Protocols 名前空間