WebOperationContext 클래스

정의

웹 요청과 웹 응답의 컨텍스트 속성에 손쉽게 액세스하도록 하는 도우미 클래스입니다.

public ref class WebOperationContext : System::ServiceModel::IExtension<System::ServiceModel::OperationContext ^>
public ref class WebOperationContext
public class WebOperationContext : System.ServiceModel.IExtension<System.ServiceModel.OperationContext>
public class WebOperationContext
type WebOperationContext = class
    interface IExtension<OperationContext>
type WebOperationContext = class
Public Class WebOperationContext
Implements IExtension(Of OperationContext)
Public Class WebOperationContext
상속
WebOperationContext
구현

예제

다음 코드는 현재 호출의 UriTemplateMatch 웹 작업 컨텍스트와 연결된 인스턴스를 검색하는 방법을 보여줍니다. 또한 이 코드는 나가는 응답에 대한 HTTP 상태를 설정하는 방법을 보여 줍니다.

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)

생성자

WebOperationContext(OperationContext)

지정된 WebOperationContext 인스턴스를 사용하여 OperationContext 클래스의 새 인스턴스를 초기화합니다.

속성

Current

현재 웹 작업 컨텍스트를 가져옵니다.

IncomingRequest

수신할 요청의 웹 요청 컨텍스트를 가져옵니다.

IncomingResponse

수신할 요청의 웹 응답 컨텍스트를 가져옵니다.

OutgoingRequest

전송할 요청의 웹 요청 컨텍스트를 가져옵니다.

OutgoingResponse

전송할 응답의 웹 응답 컨텍스트를 가져옵니다.

메서드

Attach(OperationContext)

현재 WebOperationContext 인스턴스를 지정된 OperationContext 인스턴스에 연결합니다.

CreateAtom10Response(ServiceDocument)

지정된 내용으로 Atom 1.0 사양에 맞는 형식의 메시지를 만듭니다.

CreateAtom10Response(SyndicationFeed)

지정된 내용으로 Atom 1.0 사양에 맞는 형식의 메시지를 만듭니다.

CreateAtom10Response(SyndicationItem)

지정된 내용으로 Atom 1.0 사양에 맞는 형식의 메시지를 만듭니다.

CreateJsonResponse<T>(T)

JSON 형식의 메시지를 만듭니다.

CreateJsonResponse<T>(T, DataContractJsonSerializer)

JSON 형식의 메시지를 만듭니다.

CreateStreamResponse(Action<Stream>, String)

스트림 형식의 메시지를 만듭니다.

CreateStreamResponse(Stream, String)

스트림 형식의 메시지를 만듭니다.

CreateStreamResponse(StreamBodyWriter, String)

스트림 형식의 메시지를 만듭니다.

CreateTextResponse(Action<TextWriter>, String)

텍스트 형식의 메시지를 만듭니다.

CreateTextResponse(Action<TextWriter>, String, Encoding)

텍스트 형식의 메시지를 만듭니다.

CreateTextResponse(String)

텍스트 형식의 응답 메시지를 만듭니다.

CreateTextResponse(String, String)

텍스트 형식의 메시지를 만듭니다.

CreateTextResponse(String, String, Encoding)

텍스트 형식의 메시지를 만듭니다.

CreateXmlResponse(XDocument)

XML 형식의 메시지를 만듭니다.

CreateXmlResponse(XElement)

XML 형식의 메시지를 만듭니다.

CreateXmlResponse<T>(T)

XML 형식의 메시지를 만듭니다.

CreateXmlResponse<T>(T, XmlObjectSerializer)

XML 형식의 메시지를 만듭니다.

CreateXmlResponse<T>(T, XmlSerializer)

XML 형식의 메시지를 만듭니다.

Detach(OperationContext)

현재 WebOperationContext 인스턴스를 지정된 OperationContext 인스턴스에서 분리합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
GetUriTemplate(String)

지정된 작업과 연결된 URI 템플릿을 가져옵니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상