CustomBinding Construtores

Definição

Inicializa uma nova instância da CustomBinding classe.

Sobrecargas

Name Description
CustomBinding()

Inicializa uma nova instância da CustomBinding classe.

CustomBinding(IEnumerable<BindingElement>)

Inicializa uma nova instância da CustomBinding classe com os elementos de ligação a partir de uma pilha completa de canais.

CustomBinding(Binding)

Inicializa uma nova instância da CustomBinding classe a partir dos valores de uma ligação especificada.

CustomBinding(BindingElement[])

Inicializa uma nova instância da CustomBinding classe a partir de um array de elementos de ligação.

CustomBinding(String)

Inicializa uma nova instância da CustomBinding classe.

CustomBinding(String, String, BindingElement[])

Inicializa uma nova instância da CustomBinding classe a partir de um array de elementos de ligação com um nome e espaço de nomes especificados.

CustomBinding()

Origem:
CustomBinding.cs
Origem:
CustomBinding.cs
Origem:
CustomBinding.cs

Inicializa uma nova instância da CustomBinding classe.

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

Exemplos

O exemplo seguinte mostra como usar o construtor sem parâmetros:

Aplica-se a

CustomBinding(IEnumerable<BindingElement>)

Origem:
CustomBinding.cs
Origem:
CustomBinding.cs
Origem:
CustomBinding.cs

Inicializa uma nova instância da CustomBinding classe com os elementos de ligação a partir de uma pilha completa de canais.

public:
 CustomBinding(System::Collections::Generic::IEnumerable<System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding(System.Collections.Generic.IEnumerable<System.ServiceModel.Channels.BindingElement> bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : seq<System.ServiceModel.Channels.BindingElement> -> System.ServiceModel.Channels.CustomBinding
Public Sub New (bindingElementsInTopDownChannelStackOrder As IEnumerable(Of BindingElement))

Parâmetros

bindingElementsInTopDownChannelStackOrder
IEnumerable<BindingElement>

Um IEnumerable<T> de tipo BindingElement que contém os elementos de ligação da pilha de canais em ordem top-down.

Exceções

bindingElementsInTopDownChannelStackOrder é null.

Exemplos

Uri baseAddress = new Uri("http://localhost:8000/servicemodelsamples/service");

// Create a ServiceHost for the CalculatorService type and provide the base address.
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

// Create a custom binding that contains two binding elements.
ReliableSessionBindingElement reliableSession = new ReliableSessionBindingElement();
reliableSession.Ordered = true;

HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;

SynchronizedCollection<BindingElement> coll = new SynchronizedCollection<BindingElement>();
coll.Add(reliableSession);
coll.Add(httpTransport);

CustomBinding binding = new CustomBinding(coll);
Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

' Create a custom binding that contains two binding elements.
Dim reliableSession As New ReliableSessionBindingElement()
reliableSession.Ordered = True

Dim httpTransport As New HttpTransportBindingElement()
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard

Dim coll As New SynchronizedCollection(Of BindingElement)()
coll.Add(reliableSession)
coll.Add(httpTransport)

Dim binding As New CustomBinding(coll)

Aplica-se a

CustomBinding(Binding)

Origem:
CustomBinding.cs
Origem:
CustomBinding.cs
Origem:
CustomBinding.cs

Inicializa uma nova instância da CustomBinding classe a partir dos valores de uma ligação especificada.

public:
 CustomBinding(System::ServiceModel::Channels::Binding ^ binding);
public CustomBinding(System.ServiceModel.Channels.Binding binding);
new System.ServiceModel.Channels.CustomBinding : System.ServiceModel.Channels.Binding -> System.ServiceModel.Channels.CustomBinding
Public Sub New (binding As Binding)

Parâmetros

binding
Binding

O Binding que é usado para inicializar a ligação personalizada.

Exceções

binding é null.

Aplica-se a

CustomBinding(BindingElement[])

Origem:
CustomBinding.cs
Origem:
CustomBinding.cs
Origem:
CustomBinding.cs

Inicializa uma nova instância da CustomBinding classe a partir de um array de elementos de ligação.

public:
 CustomBinding(... cli::array <System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding(params System.ServiceModel.Channels.BindingElement[] bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : System.ServiceModel.Channels.BindingElement[] -> System.ServiceModel.Channels.CustomBinding
Public Sub New (ParamArray bindingElementsInTopDownChannelStackOrder As BindingElement())

Parâmetros

bindingElementsInTopDownChannelStackOrder
BindingElement[]

O Array tipo BindingElement of usado para inicializar a ligação personalizada.

Exceções

bindingElementsInTopDownChannelStackOrder é null.

Exemplos

 Uri baseAddress = new Uri("http://localhost:8000/servicemodelsamples/service");

// Create a ServiceHost for the CalculatorService type and provide the base address.
 ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

// Create a custom binding that contains two binding elements.
ReliableSessionBindingElement reliableSession = new ReliableSessionBindingElement();
reliableSession.Ordered = true;

HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;

BindingElement[] elements = new BindingElement[2];
elements[0] = reliableSession;
elements[1] = httpTransport;

CustomBinding binding = new CustomBinding(elements);
 Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
 Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

' Create a custom binding that contains two binding elements.
Dim reliableSession As New ReliableSessionBindingElement()
reliableSession.Ordered = True

Dim httpTransport As New HttpTransportBindingElement()
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard

Dim elements(1) As BindingElement
elements(0) = reliableSession
elements(1) = httpTransport

Dim binding As New CustomBinding(elements)

Aplica-se a

CustomBinding(String)

Inicializa uma nova instância da CustomBinding classe.

public:
 CustomBinding(System::String ^ configurationName);
public CustomBinding(string configurationName);
new System.ServiceModel.Channels.CustomBinding : string -> System.ServiceModel.Channels.CustomBinding
Public Sub New (configurationName As String)

Parâmetros

configurationName
String

Um valor do configurationName atributo que identifica o binding elemento cujas definições são usadas para inicializar a ligação.

Exceções

O elemento de ligação identificado pelo configurationName é null.

Aplica-se a

CustomBinding(String, String, BindingElement[])

Origem:
CustomBinding.cs
Origem:
CustomBinding.cs
Origem:
CustomBinding.cs

Inicializa uma nova instância da CustomBinding classe a partir de um array de elementos de ligação com um nome e espaço de nomes especificados.

public:
 CustomBinding(System::String ^ name, System::String ^ ns, ... cli::array <System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding(string name, string ns, params System.ServiceModel.Channels.BindingElement[] bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : string * string * System.ServiceModel.Channels.BindingElement[] -> System.ServiceModel.Channels.CustomBinding
Public Sub New (name As String, ns As String, ParamArray bindingElementsInTopDownChannelStackOrder As BindingElement())

Parâmetros

name
String

O nome da encadernação.

ns
String

O namespace da encadernação.

bindingElementsInTopDownChannelStackOrder
BindingElement[]

O Array tipo BindingElement of usado para inicializar a ligação personalizada.

Exceções

bindingElementsInTopDownChannelStackOrder é null.

Exemplos

Uri baseAddress = new Uri("http://localhost:8000/servicemodelsamples/service");

// Create a ServiceHost for the CalculatorService type and provide the base address.
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

// Create a custom binding that contains two binding elements.
ReliableSessionBindingElement reliableSession = new ReliableSessionBindingElement();
reliableSession.Ordered = true;

HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;

BindingElement[] elements = new BindingElement[2];
elements[0] = reliableSession;
elements[1] = httpTransport;

CustomBinding binding = new CustomBinding("MyCustomBinding", "http://localhost/service", elements);
Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

' Create a custom binding that contains two binding elements.
Dim reliableSession As New ReliableSessionBindingElement()
reliableSession.Ordered = True

Dim httpTransport As New HttpTransportBindingElement()
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous
httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard

Dim elements(1) As BindingElement
elements(0) = reliableSession
elements(1) = httpTransport

Dim binding As New CustomBinding("MyCustomBinding", "http://localhost/service", elements)

Aplica-se a