Compartir a través de


CustomBinding Constructores

Definición

Inicializa una nueva instancia de la clase CustomBinding.

Sobrecargas

CustomBinding()

Inicializa una nueva instancia de la clase CustomBinding.

CustomBinding(IEnumerable<BindingElement>)

Inicializa una nueva instancia de la clase CustomBinding con los elementos de enlace de una pila del canal completa.

CustomBinding(Binding)

Inicializa una nueva instancia de la clase CustomBinding a partir de los valores un enlace especificado.

CustomBinding(BindingElement[])

Inicializa una nueva instancia de la clase CustomBinding a partir de una matriz de elementos de enlace.

CustomBinding(String)

Inicializa una nueva instancia de la clase CustomBinding.

CustomBinding(String, String, BindingElement[])

Inicializa una nueva instancia de la clase CustomBinding de una matriz de elementos de enlace con nombre y espacio de nombres especificados.

CustomBinding()

Source:
CustomBinding.cs
Source:
CustomBinding.cs
Source:
CustomBinding.cs

Inicializa una nueva instancia de la clase CustomBinding.

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

Ejemplos

En el ejemplo siguiente se muestra cómo usar el constructor sin parámetros:

Se aplica a

CustomBinding(IEnumerable<BindingElement>)

Source:
CustomBinding.cs
Source:
CustomBinding.cs
Source:
CustomBinding.cs

Inicializa una nueva instancia de la clase CustomBinding con los elementos de enlace de una pila del canal completa.

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>

IEnumerable<T> de tipo BindingElement que contiene los elementos de enlace de la pila del canal en orden descendente.

Excepciones

bindingElementsInTopDownChannelStackOrder es null.

Ejemplos

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)

Se aplica a

CustomBinding(Binding)

Source:
CustomBinding.cs
Source:
CustomBinding.cs
Source:
CustomBinding.cs

Inicializa una nueva instancia de la clase CustomBinding a partir de los valores un enlace especificado.

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

Binding que se utiliza para inicializar el enlace personalizado.

Excepciones

binding es null.

Se aplica a

CustomBinding(BindingElement[])

Source:
CustomBinding.cs
Source:
CustomBinding.cs
Source:
CustomBinding.cs

Inicializa una nueva instancia de la clase CustomBinding a partir de una matriz de elementos de enlace.

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[]

Array de tipo BindingElement utilizado para inicializar el enlace personalizado.

Excepciones

bindingElementsInTopDownChannelStackOrder es null.

Ejemplos

 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)

Se aplica a

CustomBinding(String)

Inicializa una nueva instancia de la clase CustomBinding.

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

Un valor del atributo configurationName que identifica el elemento de binding cuya configuración se utiliza para inicializar el enlace.

Excepciones

El elemento de enlace identificado por configurationName es null.

Se aplica a

CustomBinding(String, String, BindingElement[])

Source:
CustomBinding.cs
Source:
CustomBinding.cs
Source:
CustomBinding.cs

Inicializa una nueva instancia de la clase CustomBinding de una matriz de elementos de enlace con nombre y espacio de nombres 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

Nombre del enlace.

ns
String

Espacio de nombres del enlace.

bindingElementsInTopDownChannelStackOrder
BindingElement[]

Array de tipo BindingElement utilizado para inicializar el enlace personalizado.

Excepciones

bindingElementsInTopDownChannelStackOrder es null.

Ejemplos

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)

Se aplica a