Freigeben über


WebOperationContext.OutgoingResponse Eigenschaft

Definition

Ruft den Webantwortkontext für die gesendete Antwort ab.

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

Eigenschaftswert

Eine OutgoingWebResponseContext-Instanz.

Beispiele

Im folgenden Code wird beschrieben, wie der Status der ausgehenden Antwort festgelegt wird.

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)

Gilt für: