This documentation is archived and is not being maintained.

SoapDocumentMethodAttribute.ParameterStyle Property

Gets or sets whether parameters are encapsulated within a single XML element beneath the Body element in the XML portion of a SOAP message.

[Visual Basic]
Public Property ParameterStyle As SoapParameterStyle
public SoapParameterStyle ParameterStyle {get; set;}
public: __property SoapParameterStyle get_ParameterStyle();
public: __property void set_ParameterStyle(SoapParameterStyle);
public function get ParameterStyle() : SoapParameterStyle;
public function set ParameterStyle(SoapParameterStyle);

Property Value

The SoapParameterStyle for SOAP messages sent to and from an XML Web service method. The default value is Wrapped.


[Visual Basic, C#] The following code example specifies that parameters sent in the SOAP messages sent to and from the PlaceOrder XML Web service method are not encapsulated within one XML element.

[Visual Basic] 
<%@ 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

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

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

SoapDocumentMethodAttribute Class | SoapDocumentMethodAttribute Members | System.Web.Services.Protocols Namespace | SoapParameterStyle | Customizing SOAP Messages