WebService 클래스

정의

애플리케이션 및 세션 상태와 같은 공용 ASP.NET 개체에 직접 액세스할 수 있도록 해주는 XML Web services에 대한 선택적 기본 클래스를 정의합니다.

public ref class WebService : System::ComponentModel::MarshalByValueComponent
public class WebService : System.ComponentModel.MarshalByValueComponent
type WebService = class
    inherit MarshalByValueComponent
Public Class WebService
Inherits MarshalByValueComponent
상속
파생

예제

아래 예제에서 파생 되는 XML 웹 서비스를 만듭니다 WebService을 사용 하려면를 Context 서버의 요청 시간을 얻기 위해 속성입니다.

<%@ WebService Language="C#" Class="Util" %>
 
 using System;
 using System.Web.Services;
 
 public class Util: WebService {
   [ WebMethod(Description="Returns the time as stored on the Server",
   EnableSession=false)]
   public string Time() {
      return Context.Timestamp.TimeOfDay.ToString();
   }
 }
<%@ WebService Language="VB" Class="Util" %>
 
Imports System
Imports System.Web.Services

Public Class Util
    Inherits WebService
    
    <WebMethod(Description := "Returns the time as stored on the Server", _
        EnableSession := False)> _
    Public Function Time() As String
        
        Return Context.Timestamp.TimeOfDay.ToString()
    End Function
End Class

설명

파생 하지 않고 XML 웹 서비스를 계속 만들 수 공통 ASP.NET 개체에 액세스할 필요가 없는 경우 WebService합니다. 다른 ASP.NET 개체를 통해 액세스할 수 있습니다 Context합니다.

XML 웹 서비스 메서드를 OneWay 속성에 대 SoapRpcMethodAttribute 또는 SoapDocumentMethodAttribute 로 설정 true에 대 한 액세스 권한이 없습니다 해당 HttpContext합니다. 이와 같이의 속성 중 하나에 액세스 합니다 WebService 클래스는 XML 웹 서비스 메서드 내에서 반환 하는 null합니다.

있는.NET Framework 버전 1.0 XML 웹 서비스 메서드를 사용 하는 경우는 SoapRpcMethodAttribute 또는 SoapDocumentMethodAttribute 특성을 사용 하 여 적용할 합니다 OneWay 집합의 속성 true에 대 한 액세스 권한이 없습니다 해당 HttpContext 를 사용 하 여는 정적 Current 속성입니다. 액세스는 HttpContext에서 XML 웹 서비스 메서드를 구현 하는 클래스를 파생 WebService 액세스는 Context 속성.

생성자

WebService()

WebService 클래스의 새 인스턴스를 초기화합니다.

속성

Application

현재 HTTP 요청에 대한 애플리케이션 개체를 가져옵니다.

Container

구성 요소의 컨테이너를 가져옵니다.

(다음에서 상속됨 MarshalByValueComponent)
Context

현재 요청에 대한 ASP.NET HttpContext를 가져오며 이것은 웹 요청을 처리하기 위해 HTTP 서버가 사용하는 모든 HTTP 관련 컨텍스트를 캡슐화합니다.

DesignMode

구성 요소가 현재 디자인 모드에 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MarshalByValueComponent)
Events

이 구성 요소에 연결된 이벤트 처리기의 목록을 가져옵니다.

(다음에서 상속됨 MarshalByValueComponent)
Server

현재 요청에 대한 HttpServerUtility를 가져옵니다.

Session

현재 요청에 대한 HttpSessionState 인스턴스를 가져옵니다.

Site

구성 요소의 사이트를 가져오거나 설정합니다.

(다음에서 상속됨 MarshalByValueComponent)
SoapVersion

XML Web services에 대한 SOAP 요청을 수행하는 데 사용된 SOAP 프로토콜의 버전을 가져옵니다.

User

ASP.NET 서버 User 개체를 가져옵니다. 이 속성은 사용자가 요청을 실행할 권한이 있는지 여부를 인증하는 데 사용할 수 있습니다.

메서드

Dispose()

MarshalByValueComponent에서 사용하는 모든 리소스를 해제합니다.

(다음에서 상속됨 MarshalByValueComponent)
Dispose(Boolean)

MarshalByValueComponent에서 사용하는 관리되지 않는 리소스를 해제하고, 관리되는 리소스를 선택적으로 해제할 수 있습니다.

(다음에서 상속됨 MarshalByValueComponent)
Equals(Object)

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

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

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

(다음에서 상속됨 Object)
GetService(Type)

IServiceProvider의 구현자를 가져옵니다.

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

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

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

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

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

Component의 이름이 포함된 String을 반환합니다(있는 경우). 이 메서드는 재정의할 수 없습니다.

(다음에서 상속됨 MarshalByValueComponent)

이벤트

Disposed

구성 요소의 Disposed 이벤트를 수신할 이벤트 처리기를 추가합니다.

(다음에서 상속됨 MarshalByValueComponent)

적용 대상