Aracılığıyla paylaş


WebInvokeAttribute.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]
[WebInvoke(UriTemplate = "Div?x={x}&y={y}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Xml, ResponseFormat=WebMessageFormat.Xml)]
long Divide(long x, long y);
<OperationContract()> _
<WebInvoke(UriTemplate:="Div?x={x}&y={y}", BodyStyle:=WebMessageBodyStyle.Bare, RequestFormat:=WebMessageFormat.Xml, ResponseFormat:=WebMessageFormat.Xml)> _
Function Divide(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. Olası değerler ve JsonşeklindedirXml.

Şunlara uygulanır