WebGetAttribute.ResponseFormat 屬性

定義

取得或設定 ResponseFormat 屬性。

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

屬性值

其中一個 WebMessageFormat 列舉值。

範例

下列範例會示範如何設定 ResponseFormat 屬性。

[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

備註

此屬性決定服務作業發出的回應格式。 兩個可能值為 XmlJson

適用於