Compartir a través de


WebOperationContext.OutgoingResponse Propiedad

Definición

Obtiene el contexto de respuesta web para la respuesta que se está enviando.

public:
 property System::ServiceModel::Web::OutgoingWebResponseContext ^ OutgoingResponse { System::ServiceModel::Web::OutgoingWebResponseContext ^ get(); };
public System.ServiceModel.Web.OutgoingWebResponseContext OutgoingResponse { get; }
member this.OutgoingResponse : System.ServiceModel.Web.OutgoingWebResponseContext
Public ReadOnly Property OutgoingResponse As OutgoingWebResponseContext

Valor de propiedad

OutgoingWebResponseContext

Instancia de OutgoingWebResponseContext.

Ejemplos

El código siguiente muestra cómo establecer el estado de la respuesta de salida.

counter++;

UriTemplateMatch match = WebOperationContext.Current.IncomingRequest.UriTemplateMatch;

UriTemplate template = new UriTemplate("{id}");
customer.Uri = template.BindByPosition(match.BaseUri, counter.ToString());

customers[counter.ToString()] = customer;

WebOperationContext.Current.OutgoingResponse.SetStatusAsCreated(customer.Uri);
counter = counter + 1

Dim match As UriTemplateMatch = WebOperationContext.Current.IncomingRequest.UriTemplateMatch
Dim template As New UriTemplate("{id}")

customer.Uri = template.BindByPosition(match.BaseUri, counter.ToString())
customers(counter.ToString()) = customer
WebOperationContext.Current.OutgoingResponse.SetStatusAsCreated(customer.Uri)

Se aplica a