CustomBinding CustomBinding CustomBinding CustomBinding Constructors

Definition

Überlädt

CustomBinding() CustomBinding() CustomBinding()

Initialisiert eine neue Instanz der CustomBinding-Klasse. Initializes a new instance of the CustomBinding class.

CustomBinding(IEnumerable<BindingElement>) CustomBinding(IEnumerable<BindingElement>) CustomBinding(IEnumerable<BindingElement>) CustomBinding(IEnumerable<BindingElement>)

Initialisiert eine neue Instanz der CustomBinding-Klasse mit den Bindungselementen aus einem vollständigen Kanalstapel. Initializes a new instance of the CustomBinding class with the binding elements from a complete channel stack.

CustomBinding(Binding) CustomBinding(Binding) CustomBinding(Binding)

Initialisiert eine neue Instanz der CustomBinding-Klasse aus den Werten einer angegebenen Bindung. Initializes a new instance of the CustomBinding class from the values of a specified binding.

CustomBinding(BindingElement[]) CustomBinding(BindingElement[]) CustomBinding(BindingElement[]) CustomBinding(BindingElement[])

Initialisiert eine neue Instanz der CustomBinding-Klasse aus einem Array von Bindungselementen. Initializes a new instance of the CustomBinding class from an array of binding elements.

CustomBinding(String) CustomBinding(String) CustomBinding(String) CustomBinding(String)

Initialisiert eine neue Instanz der CustomBinding-Klasse. Initializes a new instance of the CustomBinding class.

CustomBinding(String, String, BindingElement[]) CustomBinding(String, String, BindingElement[]) CustomBinding(String, String, BindingElement[]) CustomBinding(String, String, BindingElement[])

Initialisiert eine neue Instanz der CustomBinding-Klasse aus einem Array an Bindungselementen mit einem spezifischen Namen und Namespace. Initializes a new instance of the CustomBinding class from an array of binding elements with a specified name and namespace.

CustomBinding() CustomBinding() CustomBinding()

Initialisiert eine neue Instanz der CustomBinding-Klasse. Initializes a new instance of the CustomBinding class.

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

Beispiele

Im folgenden Beispiel wird die Verwendung des Standardkonstruktors veranschaulicht.The following example shows how to use the default constructor:

CustomBinding(IEnumerable<BindingElement>) CustomBinding(IEnumerable<BindingElement>) CustomBinding(IEnumerable<BindingElement>) CustomBinding(IEnumerable<BindingElement>)

Initialisiert eine neue Instanz der CustomBinding-Klasse mit den Bindungselementen aus einem vollständigen Kanalstapel. Initializes a new instance of the CustomBinding class with the binding elements from a complete channel stack.

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))
Parameter
bindingElementsInTopDownChannelStackOrder
IEnumerable<BindingElement>

IEnumerable<T> vom Typ BindingElement, der die Bindungselemente des Kanalstapels in der Reihenfolge von oben nach unten enthält. An IEnumerable<T> of type BindingElement that contains the binding elements of the channel stack in top-down order.

Ausnahmen

bindingElementsInTopDownChannelStackOrder ist null. bindingElementsInTopDownChannelStackOrder is null.

Beispiele

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)

CustomBinding(Binding) CustomBinding(Binding) CustomBinding(Binding)

Initialisiert eine neue Instanz der CustomBinding-Klasse aus den Werten einer angegebenen Bindung. Initializes a new instance of the CustomBinding class from the values of a specified binding.

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
Parameter
binding
Binding Binding Binding Binding

Binding, der verwendet wird, um eine benutzerdefinierte Bindung zu initialisieren. The Binding that is used to initialize the custom binding.

Ausnahmen

CustomBinding(BindingElement[]) CustomBinding(BindingElement[]) CustomBinding(BindingElement[]) CustomBinding(BindingElement[])

Initialisiert eine neue Instanz der CustomBinding-Klasse aus einem Array von Bindungselementen. Initializes a new instance of the CustomBinding class from an array of binding elements.

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())
Parameter
bindingElementsInTopDownChannelStackOrder
BindingElement[]

Der Array des Typs BindingElement, der verwendet wird, um die benutzerdefinierte Bindung zu initialisieren. The Array of type BindingElement used to initialize the custom binding.

Ausnahmen

bindingElementsInTopDownChannelStackOrder ist null. bindingElementsInTopDownChannelStackOrder is null.

Beispiele

 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)

CustomBinding(String) CustomBinding(String) CustomBinding(String) CustomBinding(String)

Initialisiert eine neue Instanz der CustomBinding-Klasse. Initializes a new instance of the CustomBinding class.

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

Ein Wert des configurationName-Attributs, das das binding-Element identifiziert, dessen Einstellungen verwendet werden, um die Bindung zu initiieren. A value of the configurationName attribute that identifies the binding element whose settings are used to initialize the binding.

Ausnahmen

Das Bindungselement, das vom configurationName identifiziert wird, ist null. The binding element identified by the configurationName is null.

Hinweise

Das Bindungselement, benannt vonThe binding element named by

CustomBinding(String, String, BindingElement[]) CustomBinding(String, String, BindingElement[]) CustomBinding(String, String, BindingElement[]) CustomBinding(String, String, BindingElement[])

Initialisiert eine neue Instanz der CustomBinding-Klasse aus einem Array an Bindungselementen mit einem spezifischen Namen und Namespace. Initializes a new instance of the CustomBinding class from an array of binding elements with a specified name and namespace.

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())
Parameter
name
String String String String

Der Name der Bindung. The name of the binding.

ns
String String String String

Der Namespace der Bindung. The namespace of the binding.

bindingElementsInTopDownChannelStackOrder
BindingElement[]

Der Array des Typs BindingElement, der verwendet wird, um die benutzerdefinierte Bindung zu initialisieren. The Array of type BindingElement used to initialize the custom binding.

Ausnahmen

bindingElementsInTopDownChannelStackOrder ist null. bindingElementsInTopDownChannelStackOrder is null.

Beispiele

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)

Gilt für: