WebOperationContext 클래스

정의

웹 요청 및 응답의 컨텍스트 속성에 쉽게 액세스할 수 있는 도우미 클래스입니다.

public ref class WebOperationContext : System::ServiceModel::IExtension<System::ServiceModel::OperationContext ^>
public class WebOperationContext : System.ServiceModel.IExtension<System.ServiceModel.OperationContext>
type WebOperationContext = class
    interface IExtension<OperationContext>
Public Class WebOperationContext
Implements IExtension(Of OperationContext)
상속
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)

생성자

Name Description
WebOperationContext(OperationContext)

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

속성

Name Description
Current

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

IncomingRequest

수신되는 요청에 대한 웹 요청 컨텍스트를 가져옵니다.

IncomingResponse

수신되는 요청에 대한 웹 응답 컨텍스트를 가져옵니다.

OutgoingRequest

전송되는 요청에 대한 웹 요청 컨텍스트를 가져옵니다.

OutgoingResponse

전송되는 응답에 대한 웹 응답 컨텍스트를 가져옵니다.

메서드

Name Description
Attach(OperationContext)

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

CreateAtom10Response(ServiceDocument)

지정된 콘텐츠를 사용하여 Atom 1.0 사양에 따라 서식이 지정된 메시지를 만듭니다.

CreateAtom10Response(SyndicationFeed)

지정된 콘텐츠를 사용하여 Atom 1.0 사양에 따라 서식이 지정된 메시지를 만듭니다.

CreateAtom10Response(SyndicationItem)

지정된 콘텐츠를 사용하여 Atom 1.0 사양에 따라 서식이 지정된 메시지를 만듭니다.

CreateJsonResponse<T>(T, DataContractJsonSerializer)

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

CreateJsonResponse<T>(T)

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

CreateStreamResponse(Action<Stream>, String)

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

CreateStreamResponse(Stream, String)

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

CreateStreamResponse(StreamBodyWriter, String)

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

CreateTextResponse(Action<TextWriter>, String, Encoding)

텍스트 서식이 지정된 메시지를 만듭니다.

CreateTextResponse(Action<TextWriter>, String)

텍스트 서식이 지정된 메시지를 만듭니다.

CreateTextResponse(String, String, Encoding)

텍스트 서식이 지정된 메시지를 만듭니다.

CreateTextResponse(String, String)

텍스트 서식이 지정된 메시지를 만듭니다.

CreateTextResponse(String)

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

CreateXmlResponse(XDocument)

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

CreateXmlResponse(XElement)

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

CreateXmlResponse<T>(T, XmlObjectSerializer)

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

CreateXmlResponse<T>(T, XmlSerializer)

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

CreateXmlResponse<T>(T)

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

Detach(OperationContext)

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

Equals(Object)

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

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

기본 해시 함수로 사용됩니다.

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

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

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

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

MemberwiseClone()

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

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

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

(다음에서 상속됨 Object)

적용 대상