次の方法で共有


WebOperationContext.OutgoingResponse プロパティ

定義

送信される応答の Web 応答コンテキストを取得します。

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

プロパティ値

OutgoingWebResponseContext のインスタンス。

送信応答のステータスを設定する方法を次のコードに示します。

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)

適用対象