次の方法で共有


SoapDocumentServiceAttribute.Use プロパティ

XML Web サービスの既定のパラメータ書式を取得または設定します。

Public Property Use As SoapBindingUse
[C#]
public SoapBindingUse Use {get; set;}
[C++]
public: __property SoapBindingUse get_Use();public: __property void set_Use(SoapBindingUse);
[JScript]
public function get Use() : SoapBindingUse;public function set Use(SoapBindingUse);

プロパティ値

XML Web サービスの既定の SoapBindingUse 。この値を設定しない場合、既定値は Literal になります。

解説

Web サービス記述言語 (WSDL: Web Services Description Language) では、XML Web サービスとの間で送受信されるパラメータの書式として、 EncodedLiteral の 2 つのスタイルを定義しています。 Encoded は、SOAP 仕様のセクション 5 に概説されている SOAP エンコーディングを使用したパラメータの書式設定を表します。 Literal は、パラメータごとに定義済みの XSD スキーマを使用したパラメータの書式指定を表します。

詳細については、「 SOAP メッセージのカスタマイズ 」を参照してください。

使用例

 
<%@ 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

[C#] 
<%@ 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;
        }
    }

[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

SoapDocumentServiceAttribute クラス | SoapDocumentServiceAttribute メンバ | System.Web.Services.Protocols 名前空間 | SoapBindingUse | SOAP メッセージのカスタマイズ