SoapDocumentMethodAttribute.Use 속성

정의

SOAP 메시지의 XML 부분에서 XML Web services 메서드의 매개 변수 형식을 가져오거나 설정합니다.

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 Web services 메서드에 대한 SoapBindingUse입니다. 기본값은 Literal입니다.

예제

다음 코드 예제에서는 지정 Document / Encoded SOAP 메시지를 전송 해야는 PlaceOrder XML 웹 서비스 메서드.

<%@ 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): EncodedLiteral입니다. Encoded SOAP 사양의 5 단원에 설명 된 대로 SOAP 인코딩을 사용 하 여 매개 변수를 서식 지정을 가리킵니다. Literal 미리 정의 된 XSD 스키마를 사용 하 여 각 매개 변수에 대 한 매개 변수의 형식을 지정 하는 방법을 가리킵니다.

자세한 내용은 참조 하세요. SOAP 메시지 형식을 사용자 지정합니다.

적용 대상

추가 정보