SoapDocumentMethodAttribute.ParameterStyle 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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
속성 값
XML Web services 메서드가 적용되는 SOAP 메시지에 대한 SoapParameterStyle입니다. 기본값은 Wrapped입니다.
예제
다음 코드 예제는 SOAP 메시지를 전송 하는 매개 변수에서 보내고 지정 된 PlaceOrder
하나의 XML 요소 내에서 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
적용 대상
추가 정보
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기