WebInvokeAttribute.ResponseFormat Właściwość

Definicja

Pobiera lub ustawia ResponseFormat właściwość .

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

Wartość właściwości

WebMessageFormat

WebMessageFormat Jedna z wartości wyliczenia.

Przykłady

W poniższym przykładzie pokazano, jak ustawić ResponseFormat właściwość .

[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

Uwagi

Ta właściwość określa format odpowiedzi wysyłanych z operacji usługi. Możliwe wartości to Xml i Json.

Dotyczy