WebGetAttribute.BodyStyle Property


Gets or sets the body style of the messages that are sent to and from the service operation.

 property System::ServiceModel::Web::WebMessageBodyStyle BodyStyle { System::ServiceModel::Web::WebMessageBodyStyle get(); void set(System::ServiceModel::Web::WebMessageBodyStyle value); };
public System.ServiceModel.Web.WebMessageBodyStyle BodyStyle { get; set; }
member this.BodyStyle : System.ServiceModel.Web.WebMessageBodyStyle with get, set
Public Property BodyStyle As WebMessageBodyStyle

Property Value


One of the WebMessageBodyStyle enumeration values.


The following example shows how to set the BodyStyle property.

[WebGet(UriTemplate = "Mult?x={x}&y={y}", BodyStyle = WebMessageBodyStyle.Bare)]
long Multiply(long x, long y);
<OperationContract()> _
<WebGet(UriTemplate:="Mult?x={x}&y={y}", BodyStyle:=WebMessageBodyStyle.Bare)> _
Function Multiply(ByVal x As Long, ByVal y As Long) As Long


When set to Bare, the result of the service operation is written directly to the body of the response message.

Applies to