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. 這兩個屬性都預設為裸機。Both attributes default to Bare.