Aracılığıyla paylaş


WebGetAttribute.ResponseFormat Özellik

Tanım

Özelliğini alır veya ayarlar 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

Özellik Değeri

WebMessageFormat

Numaralandırma değerlerinden WebMessageFormat biri.

Örnekler

Aşağıdaki örnekte özelliğin nasıl ayarlanacağı gösterilmektedir 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

Açıklamalar

Bu özellik, bir hizmet işleminden gönderilen yanıtların biçimini belirler. İki olası değer ve JsonşeklindedirXml.

Şunlara uygulanır