WebMessageBodyStyle 枚举


一个指定是否包装参数和返回值的枚举。An enumeration that specifies whether to wrap parameter and return values.

public enum class WebMessageBodyStyle
public enum WebMessageBodyStyle
type WebMessageBodyStyle = 
Public Enum WebMessageBodyStyle


Bare 0

不包装请求和响应。Both requests and responses are not wrapped.

Wrapped 1

包装请求和响应。Both requests and responses are wrapped.

WrappedRequest 2

包装请求,但不包装响应。Requests are wrapped, responses are not wrapped.

WrappedResponse 3

包装响应,但不包装请求。Responses are wrapped, requests are not wrapped.


当服务或客户端序列化参数并将值返回到消息时, 它会将它们写入基础结构提供的 XML 元素中, 并进行包装When the service or client serializes parameters and return values to a message, it writes them within infrastructure-provided XML elements and are wrapped. 有时,开发人员并不希望服务写入这些多余的 XML 元素。Sometimes developers do not want the service to write these extra XML elements. WebMessageBodyStyle 枚举会指定是否包装参数和返回值。The WebMessageBodyStyle enumeration specifies whether to wrap parameters and return values.

将此枚举与 WebGetAttributeWebInvokeAttribute 搭配使用,可控制传入与传出服务操作的数据如何显示在网络上。This enumeration is used with the WebGetAttribute and the WebInvokeAttribute to control how the data passed to and from a service operation appears on the wire. 这两个属性默认为 Bare。Both attributes default to Bare.