WebServiceAttribute 클래스

정의

XML Web services에 기능을 설명하는 문자열 등의 정보를 추가하는 데 사용됩니다.

public ref class WebServiceAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class WebServiceAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface)]
public sealed class WebServiceAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, Inherited=true)]
public sealed class WebServiceAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type WebServiceAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface)>]
type WebServiceAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, Inherited=true)>]
type WebServiceAttribute = class
    inherit Attribute
Public NotInheritable Class WebServiceAttribute
Inherits Attribute
상속
WebServiceAttribute
특성

예제

다음 예제에서는 to "Common Server Variables"Description WebServiceAttribute 속성을 설정하고 XML 네임스페이스를 .로 http://www.microsoft.com/설정합니다.

<%@ WebService Language="C#" Class= "ServerVariables"%>
 
 using System;
 using System.Web.Services;
 
 [ WebService(Description="Common Server Variables",Namespace="http://www.contoso.com/")]
 public class ServerVariables: WebService {
 
 
    [ WebMethod(Description="Obtains the Server Computer Name",EnableSession=false)]
    public string GetMachineName() {
       return Server.MachineName;
    }   
 }
<%@ WebService Language="VB" Class= "ServerVariables"%>
 
Imports System
Imports System.Web.Services

<WebService(Description := "Common Server Variables", _
 Namespace := "http://www.contoso.com/")> _
Public Class ServerVariables
    Inherits WebService 
    
    <WebMethod(Description := "Obtains the Computer Machine Name", _
        EnableSession := False)> _
    Public Function GetMachineName() As String
        
        Return Server.MachineName
    End Function
End Class

설명

WebServiceAttribute XML 웹 서비스를 게시 하 고 실행에 필수적 요소가 아닙니다. 사용할 수는 WebServiceAttribute XML 웹 서비스에 대 한 서비스 설명과 서비스 도움말 페이지에 사용 되는 공용 언어 런타임 식별자에 대 한 규칙에 의해 제한 되지 않는 XML 웹 서비스에 대 한 이름을 지정 합니다.

XML 웹 서비스를 공개 하기 전에 기본 XML 네임 스페이스를 변경 해야 합니다. 각 XML 웹 서비스 클라이언트 애플리케이션 웹의 다른 서비스와에서 구분할 수 있도록 식별 하기 위해 고유한 XML 네임 스페이스를 해야 합니다. http://tempuri.org/ 개발 중인 XML Web services 하지만 게시 된 XML Web services는 더 영구적인 네임 스페이스를 사용 해야는 사용할 수 있습니다.

XML 웹 서비스를 제어 하는 XML 네임 스페이스로 식별 되어야 합니다. 예를 들어, XML 네임 스페이스의 일부로 회사 인터넷 도메인 이름을 사용할 수 있습니다. 여러 개의 XML 웹 서비스 XML 네임 스페이스 Url 같이, 하지만 웹에서 실제 리소스를 가리키지 않습니다 필요. (XML 웹 서비스에 대 한 XML 네임 스페이스는 Uri입니다.) ASP.NET을 사용 하 여 만든 XML Web services에 대 한 기본 XML 네임 스페이스 변경할 수 있습니다 사용 하 여 Namespace 속성입니다.

특성을 사용 하는 방법에 대 한 자세한 내용은 참조 하세요. 특성합니다.

생성자

WebServiceAttribute()

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

필드

DefaultNamespace

Namespace 속성의 기본값입니다. 이 필드는 상수입니다.

속성

Description

XML Web services에 대한 설명 메시지입니다.

Name

XML Web services의 이름을 가져오거나 설정합니다.

Namespace

XML Web services에 사용할 기본 XML 네임스페이스를 가져오거나 설정합니다.

TypeId

파생 클래스에서 구현된 경우 이 Attribute에 대한 고유 식별자를 가져옵니다.

(다음에서 상속됨 Attribute)

메서드

Equals(Object)

이 인스턴스가 지정된 개체와 같은지를 나타내는 값을 반환합니다.

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

이 인스턴스의 해시 코드를 반환합니다.

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

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

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

파생 클래스에서 재정의된 경우 이 인스턴스 값이 파생 클래스에 대한 기본값인지 여부를 표시합니다.

(다음에서 상속됨 Attribute)
Match(Object)

파생 클래스에서 재정의된 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

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

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

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

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

이름 집합을 해당하는 디스패치 식별자 집합에 매핑합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

개체에서 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1).

(다음에서 상속됨 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

개체에서 노출하는 메서드와 속성에 대한 액세스를 제공합니다.

(다음에서 상속됨 Attribute)

적용 대상

추가 정보