WebServiceBindingAttribute 클래스

정의

하나 이상의 XML Web services 메서드를 정의하는 바인딩을 선언합니다. 이 클래스는 상속될 수 없습니다.

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

예제

다음 XML 웹 서비스 바인딩이에서 작업을 구현합니다. XML 웹 서비스의 3 개를 적용 하 여 작업을 구현 하는 세 가지 바인딩 선언 특히 WebServiceBindingAttribute XML 웹 서비스에 대 한 특성입니다.

에 대 한 작업을 구현 하는 바인딩 XML 웹 서비스 메서드를 지정 하는 SoapDocumentMethodAttribute 제외 하 고 각 XML 웹 서비스 메서드에 적용 됩니다 DefaultBindingMethod합니다. 에 대 한 바인딩을 지정 하지 DefaultBindingMethod, XML 웹 서비스에 대 한 기본 바인딩에 대 한 작업을 구현 하는 것입니다.

<%@ WebService Language="C#" class="BindingSample" %>
 using System;
 using System.Web.Services;
 using System.Web.Services.Protocols;

 // Binding is defined in this XML Web service and uses the default namespace.
 [ WebServiceBinding(Name="LocalBinding")]

 // Binding is defined in this XML Web service, but it is not a part of the default namespace.
 [ WebServiceBinding(Name="LocalBindingNonDefaultNamespace", 
             Namespace="http://www.contoso.com/MyBinding" )]

 // Binding is defined on a remote server, but this XML Web service implements at least one operation in that binding.
 [ WebServiceBinding(Name="RemoteBinding", 
          Namespace="http://www.contoso.com/MyBinding",
          Location="http://www.contoso.com/MySevice.asmx?wsdl")]
 public class BindingSample  {

      [ SoapDocumentMethod(Binding="LocalBinding")]
      [ WebMethod() ]
      public string LocalBindingMethod() {
               return "Member of binding defined in this XML Web service and member of the default namespace";
      }
      [ SoapDocumentMethod(Binding="LocalBindingNonDefaultNamespace")] 
      [ WebMethod() ]
      public string LocalBindingNonDefaultNamespaceMethod() {
              return "Member of binding defined in this XML Web service, but a part of a different namespace";
      }

     [ SoapDocumentMethod(Binding="RemoteBinding")] 
     [ WebMethod() ]
      public string RemoteBindingMethod() {
              return "Member of a binding defined on another server";
      }

      [ WebMethod() ]
      public string DefaultBindingMethod() {
              return "Member of the default binding";
      }
 
 }
<%@ WebService Language="VB" class="BindingSample" %>
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols

' Binding is defined in this XML Web service and uses the default namespace.
' Binding is defined in this XML Web service, but it is not a part of the default
' namespace.
' Binding is defined on a remote server, but this XML Web service implements at
' least one operation in that binding.
<WebServiceBinding(Name := "LocalBinding"), _ 
 WebServiceBinding(Name := "LocalBindingNonDefaultNamespace", _ 
                   Namespace := "http://www.contoso.com/MyBinding"), _     
 WebServiceBinding(Name := "RemoteBinding", _ 
                   Namespace := "http://www.contoso.com/MyBinding", _
                   Location := "http://www.contoso.com/MySevice.asmx?wsdl")> _
Public Class BindingSample
    
    <SoapDocumentMethod(Binding := "LocalBinding"), WebMethod()> _
    Public Function LocalBindingMethod() As String
        
        Return "Member of binding defined in this XML Web service and member of the default namespace"
    End Function
    
    <SoapDocumentMethod(Binding := "LocalBindingNonDefaultNamespace"), WebMethod()> _
    Public Function LocalBindingNonDefaultNamespaceMethod() As String
    
        Return "Member o1f binding defined in this XML Web service, but a part of a different namespace"
    End Function    
    
    <SoapDocumentMethod(Binding := "RemoteBinding"), WebMethod()> _
    Public Function RemoteBindingMethod() As String
    
        Return "Member of a binding defined on another server"
    End Function    
    
    <WebMethod()> _
    Public Function DefaultBindingMethod() As String
    
        Return "Member of the default binding"
    End Function
End Class

설명

바인딩에서 WSDL 웹 서비스 설명 언어 (), 정의 된 대로는 인터페이스와 유사한 구체적인 작업 집합을 정의 합니다. 각 XML 웹 서비스 메서드에 특정 바인딩 내에서 작업 합니다. XML 웹 서비스 메서드는 XML 웹 서비스에 대 한 기본 바인딩 또는 바인딩 내에서 지정 된 멤버는 WebServiceBindingAttribute XML 웹 서비스를 구현 하는 클래스에 적용 합니다. XML 웹 서비스를 여러 개를 적용 하 여 여러 바인딩을 구현할 수 WebServiceBindingAttribute XML 웹 서비스에 대 한 특성입니다.

한 번 이상의 WebServiceAttribute 특성을 XML 웹 서비스에 적용 되는 SoapDocumentMethodAttribute 또는 SoapRpcMethodAttribute 특정 XML 웹 서비스 메서드에서 구현 되는 바인딩 작업을 나타내기 위해 개별 XML 웹 서비스 메서드를 적용할 수 있습니다. 설정 합니다 Binding 의 속성 SoapDocumentMethodAttribute 또는 SoapRpcMethodAttribute 바인딩을 지정 하는 XML 웹 서비스 메서드 작업을 구현 합니다.

생성자

WebServiceBindingAttribute()

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

WebServiceBindingAttribute(String)

XML Web services 메서드에서 구현하고 있는 바인딩 이름을 설정하는 WebServiceBindingAttribute 클래스의 새 인스턴스를 초기화합니다.

WebServiceBindingAttribute(String, String)

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

WebServiceBindingAttribute(String, String, String)

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

속성

ConformsTo

바인딩이 준수해야 할 WSI(Web Services 상호 운용성) 사양을 가져오거나 설정합니다.

EmitConformanceClaims

바인딩이 준수 요구 사항을 나타낼지 여부를 지정하는 값을 가져오거나 설정합니다.

Location

바인딩이 정의된 위치를 가져오거나 설정합니다.

Name

바인딩의 이름을 가져오거나 설정합니다.

Namespace

바인딩과 관련된 네임스페이스를 가져오거나 설정합니다.

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)

적용 대상

추가 정보