SoapDocumentMethodAttribute.Use 속성

정의

SOAP 메시지의 XML 부분 내에서 XML 웹 서비스 메서드에 대한 매개 변수 서식을 가져오거나 설정합니다.

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

속성 값

SoapBindingUse XML 웹 서비스 메서드의 경우입니다. 기본값은 Literal입니다.

예제

다음 코드 예제에서는 SOAP 메시지를 XML 웹 서비스 메서드로 Document 보내야 한다고 지정 / EncodedPlaceOrder합니다.

<%@ WebService Language="C#" Class="ShoppingCart" %>
 
 using System.Web.Services;
 using System.Web.Services.Protocols;
 using System.Web.Services.Description;
 using System;

 public class ShoppingCart 
 {
       [ SoapDocumentMethod(Use=SoapBindingUse.Encoded) ]
       [ WebMethod]
       public void PlaceOrder(OrderItem O) 
       {
        // Process the order on the back end.
       }      
 }

public class OrderItem
{
  public int Count;
  public int Description;
  public DateTime OrderDate;
  public long CustomerID;
  public Decimal Cost;
}
<%@ WebService Language="VB" Class="ShoppingCart" %>
 
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Services.Description
Imports System

Public Class ShoppingCart
        
    ' Specify that the XML Web service method uses encoded SOAP messages.
    <SoapDocumentMethod(Use:=SoapBindingUse.Encoded), _
     WebMethod()> _
    Public Sub PlaceOrder(O as OrderItem)
        
        ' Process the order on the back end.
    End Sub
End Class

Public Class OrderItem
  Public Count As Integer
  Public Description as String
  Public OrderDate as DateTime
  Public CustomerID as Long
  Public Cost as Decimal

End Class

설명

WSDL(Web Services Description Language)은 매개 변수 Encoded 서식을 지정하는 두 가지 메서드를 정의합니다 Literal. Encoded 는 섹션 5의 SOAP 사양에 설명된 대로 SOAP 인코딩을 사용하여 매개 변수의 서식을 지정하는 것을 의미합니다. Literal 는 각 매개 변수에 대해 미리 정의된 XSD 스키마를 사용하여 매개 변수의 서식을 지정하는 것을 의미합니다.

자세한 내용은 SOAP 메시지 서식 사용자 지정을 참조하세요.

적용 대상

추가 정보