SoapDocumentMethodAttribute.ParameterStyle 속성

정의

매개 변수가 SOAP 메시지의 XML 부분에 있는 요소 아래에 Body 있는 단일 XML 요소 내에 캡슐화되는지 여부를 가져오거나 설정합니다.

public:
 property System::Web::Services::Protocols::SoapParameterStyle ParameterStyle { System::Web::Services::Protocols::SoapParameterStyle get(); void set(System::Web::Services::Protocols::SoapParameterStyle value); };
public System.Web.Services.Protocols.SoapParameterStyle ParameterStyle { get; set; }
member this.ParameterStyle : System.Web.Services.Protocols.SoapParameterStyle with get, set
Public Property ParameterStyle As SoapParameterStyle

속성 값

SoapParameterStyle XML 웹 서비스 메서드와 주고 받는 SOAP 메시지의 경우입니다. 기본값은 Wrapped입니다.

예제

다음 코드 예제에서는 XML 웹 서비스 메서드와 주고 받는 SOAP 메시지에서 PlaceOrder 보낸 매개 변수가 하나의 XML 요소 내에 캡슐화되지 않도록 지정합니다.

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

 public class ShoppingCart 
 {
       // Specify that parameters are not encapsulated within one XML element.
       [ SoapDocumentMethod(ParameterStyle=SoapParameterStyle.Bare) ]
       [ WebMethod]
       public void PlaceOrder(OrderItem OrderDetails) 
       {
        // 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

Public Class ShoppingCart
        
    ' Specify that parameters are not encapsulated within one XML element.
    <SoapDocumentMethod(ParameterStyle:=SoapParameterStyle.Bare), _
     WebMethod()> _
    Public Sub PlaceOrder(OrderDetails 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

적용 대상

추가 정보