WebMessageBodyStyle Enumeration

Microsoft Silverlight will reach end of support after October 2021. Learn more.

An enumeration that specifies whether to wrap parameter and return values within XML elements.

Namespace:  System.ServiceModel.Web
Assembly:  System.ServiceModel.Web.Extensions (in System.ServiceModel.Web.Extensions.dll)

Syntax

'Declaration
Public Enumeration WebMessageBodyStyle
public enum WebMessageBodyStyle

Members

Member name Description
Bare Both requests and responses are not wrapped.
Wrapped Both requests and responses are wrapped.
WrappedRequest Requests are wrapped, responses are not wrapped.
WrappedResponse Responses are wrapped, requests are not wrapped.

Remarks

When the service or client serializes parameters and return values to a message, it writes them within infrastructure-provided XML elements. These XML elements are said to wrap the values. Sometimes developers do not want to wrap these extra XML elements around the serialized values. The WebMessageBodyStyle enumeration specifies whether to wrap parameters and return values.

This enumeration is used with the WebGetAttribute and the WebInvokeAttribute to control how the data passed to and from an operation appears on the wire. Both attributes default to Bare.

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.