WebServiceBindingAttribute 생성자

정의

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

오버로드

Name Description
WebServiceBindingAttribute()

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

WebServiceBindingAttribute(String)

XML 웹 서비스 메서드가 WebServiceBindingAttribute 구현하는 바인딩의 이름을 설정하는 클래스의 새 인스턴스를 초기화합니다.

WebServiceBindingAttribute(String, String)

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

WebServiceBindingAttribute(String, String, String)

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

WebServiceBindingAttribute()

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

public:
 WebServiceBindingAttribute();
public WebServiceBindingAttribute();
Public Sub New ()

적용 대상

WebServiceBindingAttribute(String)

XML 웹 서비스 메서드가 WebServiceBindingAttribute 구현하는 바인딩의 이름을 설정하는 클래스의 새 인스턴스를 초기화합니다.

public:
 WebServiceBindingAttribute(System::String ^ name);
public WebServiceBindingAttribute(string name);
new System.Web.Services.WebServiceBindingAttribute : string -> System.Web.Services.WebServiceBindingAttribute
Public Sub New (name As String)

매개 변수

name
String

XML 웹 서비스 메서드가 작업을 구현하는 바인딩의 이름입니다. Name 속성을 설정합니다.

예제

다음 예제에서는 XML 웹 서비스에 정의된 바인딩 LocalBindingBindingSample 지정합니다.

<%@ 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")]
 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";
      }

 }
<%@ WebService Language="VB" class="BindingSample" %>

Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols

' <Snippet1>
' Binding is defined in this XML Web service and uses the default namespace.
<WebServiceBinding(Name := "LocalBinding")> _
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 'LocalBindingMethod
    
End Class
   
' </Snippet1>

설명

이 생성자는 적용되는 XML 웹 서비스에 정의된 바인딩의 이름을 지정하는 데 사용되며 기본 네임스페이스의 멤버입니다.

추가 정보

적용 대상

WebServiceBindingAttribute(String, String)

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

public:
 WebServiceBindingAttribute(System::String ^ name, System::String ^ ns);
public WebServiceBindingAttribute(string name, string ns);
new System.Web.Services.WebServiceBindingAttribute : string * string -> System.Web.Services.WebServiceBindingAttribute
Public Sub New (name As String, ns As String)

매개 변수

name
String

XML 웹 서비스 메서드가 작업을 구현하는 바인딩의 이름입니다. Name 속성을 설정합니다.

ns
String

바인딩과 연결된 네임스페이스입니다. Namespace 속성을 설정합니다.

예제

다음 예제에서는 네임스페이스의 멤버 LocalBindingNonDefaultNamespace 이며 XML 웹 서비스에 정의된 바인딩 http://www.contoso.com/MyBindingBindingSample 지정합니다.

<%@ WebService Language="C#" class="BindingSample" %>

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

// <Snippet1>
// 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")]
 public class BindingSample  {

      [ SoapDocumentMethod(Binding="LocalBindingNonDefaultNamespace")] 
      [ WebMethod() ]
      public string LocalBindingNonDefaultNamespaceMethod() {
              return "Member of binding defined in this XML Web service, but a part of a different namespace";
      }
 }
 
// </Snippet1>
<%@ WebService Language="VB" class="BindingSample" %>

Imports System
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

' <Snippet1>
' 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")> _
Public Class BindingSample   
    
    <SoapDocumentMethod(Binding := "LocalBindingNonDefaultNamespace"), _
        WebMethod()> _
    Public Function LocalBindingNonDefaultNamespaceMethod() As String
        
        Return "Member of binding defined in this XML Web service, but a part " & _
               "of a different namespace"
    End Function
End Class
 
' </Snippet1>

설명

이 생성자는 XML 웹 서비스에 정의된 바인딩의 이름을 지정하는 데 사용되며 제공된 네임스페이스의 멤버입니다.

추가 정보

적용 대상

WebServiceBindingAttribute(String, String, String)

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

public:
 WebServiceBindingAttribute(System::String ^ name, System::String ^ ns, System::String ^ location);
public WebServiceBindingAttribute(string name, string ns, string location);
new System.Web.Services.WebServiceBindingAttribute : string * string * string -> System.Web.Services.WebServiceBindingAttribute
Public Sub New (name As String, ns As String, location As String)

매개 변수

name
String

XML 웹 서비스 메서드가 작업을 구현하는 바인딩의 이름입니다. Name 속성을 설정합니다.

ns
String

바인딩과 연결된 네임스페이스입니다. Namespace 속성을 설정합니다.

location
String

바인딩이 정의된 위치입니다.

예제

다음 예제에서는 네임스페이스의 멤버 RemoteBinding 이고 에 정의된 http://www.contoso.com/MyBinding바인딩을 http://www.contoso.com/MyService.asmx?wsdl 지정합니다.

<%@ WebService language="C#" class="BindingSample" %>

using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

// 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/MyService.asmx?wsdl" )]
 public class BindingSample  {

     [ SoapDocumentMethod(Binding="RemoteBinding")] 
     [ WebMethod() ]
      public string RemoteBindingMethod() {
              return "Member of a binding defined on another server";
      }
 }
<%@ WebService language="VB" class="BindingSample" %>

Imports System
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

' <Snippet1>
' 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/MyService.asmx?wsdl")> _
Public Class BindingSample    
    
    <SoapDocumentMethod(Binding := "RemoteBinding"), WebMethod()> _
    Public Function RemoteBindingMethod() As String
        
        Return "Member of a binding defined on another server"
    End Function
End Class
 
' </Snippet1>

설명

이 생성자는 XML 웹 서비스에 정의되지 않은 바인딩의 이름을 지정하는 데 사용되며, 이 이름은 제공된 네임스페이스의 멤버입니다.

추가 정보

적용 대상