Share via


SoapDocumentServiceAttribute.Use プロパティ

定義

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

public:
 property System::Web::Services::Description::SoapBindingUse Use { System::Web::Services::Description::SoapBindingUse get(); void set(System::Web::Services::Description::SoapBindingUse value); };
public System.Web.Services.Description.SoapBindingUse Use { get; set; }
member this.Use : System.Web.Services.Description.SoapBindingUse with get, set
Public Property Use As SoapBindingUse

プロパティ値

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

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

注釈

Web サービス記述言語 (WSDL) では、XML Web サービス Encoded との間で送受信されるパラメーターに対して、 と Literalの 2 つの書式設定スタイルが定義されています。 Encoded は、セクション 5 の SOAP 仕様で説明されている SOAP エンコードを使用してパラメーターを書式設定することを指します。 Literal は、各パラメーターに対して定義済みの XSD スキーマを使用してパラメーターを書式設定することを指します。

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

適用対象

こちらもご覧ください