WebGetAttribute.ResponseFormat Eigenschaft

Definition

Ruft die ResponseFormat-Eigenschaft ab oder legt diese fest.

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

Eigenschaftswert

WebMessageFormat

Einer der WebMessageFormat-Enumerationswerte.

Beispiele

Im folgenden Beispiel wird das Festlegen der ResponseFormat-Eigenschaft veranschaulicht.

[OperationContract]
[WebGet(ResponseFormat= WebMessageFormat.Json)]
long Mod(long x, long y);
<OperationContract()> _
<WebGet(ResponseFormat:=WebMessageFormat.Json)> _
Function Modulo(ByVal x As Long, ByVal y As Long) As Long

Hinweise

Mit dieser Eigenschaft wird das Format der von einem Dienstvorgang gesendeten Antworten festgelegt. Die beiden möglichen Werte lauten Xml und Json.

Gilt für