Taal

ChannelFactory<TChannel> Constructors

Definitie

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse.

Overloads

Name Description
ChannelFactory<TChannel>()

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse.

ChannelFactory<TChannel>(Binding)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse.

ChannelFactory<TChannel>(ServiceEndpoint)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse die kanalen produceert met een opgegeven eindpunt.

ChannelFactory<TChannel>(String)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse met een opgegeven eindpuntconfiguratienaam.

ChannelFactory<TChannel>(Type)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse.

ChannelFactory<TChannel>(Binding, EndpointAddress)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse met een opgegeven binding en eindpuntadres.

ChannelFactory<TChannel>(Binding, String)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse met een opgegeven binding en een extern adres.

ChannelFactory<TChannel>(String, EndpointAddress)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse die is gekoppeld aan een opgegeven naam voor de eindpuntconfiguratie en het externe adres.

ChannelFactory<TChannel>()

Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse.

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

Voorbeelden

In dit voorbeeld ziet u hoe u een nieuw object van de ChannelFactory<TChannel> klasse maakt met de IRequestChannel interface.

EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>("MyEndpoint", address);

Van toepassing op

ChannelFactory<TChannel>(Binding)

Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse.

public:
 ChannelFactory(System::ServiceModel::Channels::Binding ^ binding);
public ChannelFactory(System.ServiceModel.Channels.Binding binding);
new System.ServiceModel.ChannelFactory<'Channel> : System.ServiceModel.Channels.Binding -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (binding As Binding)

Parameters

binding
Binding

De Binding opgegeven voor de kanalen die door de fabriek worden geproduceerd.

Opmerkingen

Gebruik deze constructor als u de bindingsgegevens programmatisch wilt doorgeven in plaats van een toepassingsconfiguratiebestand te gebruiken.

Van toepassing op

ChannelFactory<TChannel>(ServiceEndpoint)

Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse die kanalen produceert met een opgegeven eindpunt.

public:
 ChannelFactory(System::ServiceModel::Description::ServiceEndpoint ^ endpoint);
public ChannelFactory(System.ServiceModel.Description.ServiceEndpoint endpoint);
new System.ServiceModel.ChannelFactory<'Channel> : System.ServiceModel.Description.ServiceEndpoint -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (endpoint As ServiceEndpoint)

Parameters

endpoint
ServiceEndpoint

De ServiceEndpoint voor de kanalen geproduceerd door de fabriek.

Uitzonderingen

De endpoint is null.

Voorbeelden

ContractDescription contract = new ContractDescription("MyContract");
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
BasicHttpBinding binding = new BasicHttpBinding();
ServiceEndpoint endpoint = new ServiceEndpoint(contract, binding, address);

ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(endpoint);

Opmerkingen

Gebruik deze constructor als u de informatie van het service-eindpunt programmatisch wilt doorgeven in plaats van een toepassingsconfiguratiebestand te gebruiken.

Van toepassing op

ChannelFactory<TChannel>(String)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse met een opgegeven eindpuntconfiguratienaam.

public:
 ChannelFactory(System::String ^ endpointConfigurationName);
public ChannelFactory(string endpointConfigurationName);
new System.ServiceModel.ChannelFactory<'Channel> : string -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (endpointConfigurationName As String)

Parameters

endpointConfigurationName
String

De configuratienaam die wordt gebruikt voor het eindpunt.

Uitzonderingen

endpointConfigurationName is null.

Voorbeelden

ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>("MyEndpoint");

Opmerkingen

Gebruik deze constructor wanneer er meer dan één doeleindpunt in het toepassingsconfiguratiebestand staat.

Van toepassing op

ChannelFactory<TChannel>(Type)

Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse.

protected:
 ChannelFactory(Type ^ channelType);
protected ChannelFactory(Type channelType);
new System.ServiceModel.ChannelFactory<'Channel> : Type -> System.ServiceModel.ChannelFactory<'Channel>
Protected Sub New (channelType As Type)

Parameters

channelType
Type

Het Type kanaal geproduceerd door de fabriek.

Uitzonderingen

De channelType is null.

Het channelType is een klasse- of waardetype en is geen interface.

Opmerkingen

Gebruik deze constructor als u de informatie van het kanaaltype programmatisch wilt doorgeven in plaats van een toepassingsconfiguratiebestand te gebruiken. De channelType parameter moet een interface zijn.

Van toepassing op

ChannelFactory<TChannel>(Binding, EndpointAddress)

Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse met een opgegeven binding en eindpuntadres.

public:
 ChannelFactory(System::ServiceModel::Channels::Binding ^ binding, System::ServiceModel::EndpointAddress ^ remoteAddress);
public ChannelFactory(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress);
new System.ServiceModel.ChannelFactory<'Channel> : System.ServiceModel.Channels.Binding * System.ServiceModel.EndpointAddress -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (binding As Binding, remoteAddress As EndpointAddress)

Parameters

binding
Binding

Het Binding eindpunt wordt geconfigureerd.

remoteAddress
EndpointAddress

De EndpointAddress locatie van de service.

Uitzonderingen

De binding is null.

Voorbeelden

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>(binding, address);

Opmerkingen

Gebruik deze constructor als u de bindings- en adresgegevens programmatisch wilt doorgeven in plaats van een toepassingsconfiguratiebestand te gebruiken.

Van toepassing op

ChannelFactory<TChannel>(Binding, String)

Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs
Bron:
ChannelFactory.cs

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse met een opgegeven binding en een extern adres.

public:
 ChannelFactory(System::ServiceModel::Channels::Binding ^ binding, System::String ^ remoteAddress);
public ChannelFactory(System.ServiceModel.Channels.Binding binding, string remoteAddress);
new System.ServiceModel.ChannelFactory<'Channel> : System.ServiceModel.Channels.Binding * string -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (binding As Binding, remoteAddress As String)

Parameters

binding
Binding

Het Binding eindpunt wordt geconfigureerd.

remoteAddress
String

Het adres dat de locatie van de service biedt.

Uitzonderingen

remoteAddress is null.

Voorbeelden

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
Uri via = new Uri("http://localhost:8000/Via");

ChannelFactory<IRequestChannel> factory =
    new ChannelFactory<IRequestChannel>(binding, "http://fsHost/fs/endp");

IRequestChannel channel = factory.CreateChannel(address, via);
channel.Open();
Message request = Message.CreateMessage(MessageVersion.Soap11, "hello");
Message reply = channel.Request(request);
Console.Out.WriteLine(reply.Headers.Action);
reply.Close();
channel.Close();
factory.Close();

Opmerkingen

Gebruik deze constructor als u de informatie over de externe adresgegevens wilt doorgeven met een tekenreeks in plaats van als een getypt object.

Van toepassing op

ChannelFactory<TChannel>(String, EndpointAddress)

Initialiseert een nieuw exemplaar van de ChannelFactory<TChannel> klasse die is gekoppeld aan een opgegeven naam voor de eindpuntconfiguratie en het externe adres.

public:
 ChannelFactory(System::String ^ endpointConfigurationName, System::ServiceModel::EndpointAddress ^ remoteAddress);
public ChannelFactory(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress);
new System.ServiceModel.ChannelFactory<'Channel> : string * System.ServiceModel.EndpointAddress -> System.ServiceModel.ChannelFactory<'Channel>
Public Sub New (endpointConfigurationName As String, remoteAddress As EndpointAddress)

Parameters

endpointConfigurationName
String

De configuratienaam die wordt gebruikt voor het eindpunt.

remoteAddress
EndpointAddress

De EndpointAddress locatie van de service.

Uitzonderingen

endpointConfigurationName of remoteAddress is null.

Voorbeelden

EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory = new ChannelFactory<IRequestChannel>("MyEndpoint", address);

Van toepassing op