Język

ChannelFactory<TChannel> Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy ChannelFactory<TChannel>.

Przeciążenia

Nazwa Opis
ChannelFactory<TChannel>()

Inicjuje nowe wystąpienie klasy ChannelFactory<TChannel>.

ChannelFactory<TChannel>(Binding)

Inicjuje nowe wystąpienie klasy ChannelFactory<TChannel>.

ChannelFactory<TChannel>(ServiceEndpoint)

Inicjuje ChannelFactory<TChannel> nowe wystąpienie klasy tworzącej kanały z określonym punktem końcowym.

ChannelFactory<TChannel>(String)

Inicjuje nowe wystąpienie ChannelFactory<TChannel> klasy o określonej nazwie konfiguracji punktu końcowego.

ChannelFactory<TChannel>(Type)

Inicjuje nowe wystąpienie klasy ChannelFactory<TChannel>.

ChannelFactory<TChannel>(Binding, EndpointAddress)

Inicjuje nowe wystąpienie ChannelFactory<TChannel> klasy z określonym powiązaniem i adresem punktu końcowego.

ChannelFactory<TChannel>(Binding, String)

Inicjuje nowe wystąpienie ChannelFactory<TChannel> klasy z określonym powiązaniem i adresem zdalnym.

ChannelFactory<TChannel>(String, EndpointAddress)

Inicjuje ChannelFactory<TChannel> nowe wystąpienie klasy skojarzonej z określoną nazwą konfiguracji punktu końcowego i adresu zdalnego.

ChannelFactory<TChannel>()

Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs

Inicjuje nowe wystąpienie klasy ChannelFactory<TChannel>.

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

Przykłady

W tym przykładzie pokazano, jak utworzyć nowy obiekt ChannelFactory<TChannel> klasy za pomocą interfejsu IRequestChannel .

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

Dotyczy

ChannelFactory<TChannel>(Binding)

Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs

Inicjuje nowe wystąpienie klasy ChannelFactory<TChannel>.

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)

Parametry

binding
Binding

Określony Binding dla kanałów produkowanych przez fabrykę.

Uwagi

Użyj tego konstruktora, jeśli chcesz programowo przekazać informacje o powiązaniu zamiast używać pliku konfiguracji aplikacji.

Dotyczy

ChannelFactory<TChannel>(ServiceEndpoint)

Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs

Inicjuje ChannelFactory<TChannel> nowe wystąpienie klasy tworzącej kanały z określonym punktem końcowym.

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)

Parametry

endpoint
ServiceEndpoint

Kanał ServiceEndpoint dla kanałów produkowanych przez fabrykę.

Wyjątki

endpoint jest null.

Przykłady

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);

Uwagi

Użyj tego konstruktora, jeśli chcesz programowo przekazać informacje o punkcie końcowym usługi zamiast używać pliku konfiguracji aplikacji.

Dotyczy

ChannelFactory<TChannel>(String)

Inicjuje nowe wystąpienie ChannelFactory<TChannel> klasy o określonej nazwie konfiguracji punktu końcowego.

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)

Parametry

endpointConfigurationName
String

Nazwa konfiguracji używana dla punktu końcowego.

Wyjątki

Parametr endpointConfigurationName ma wartość null.

Przykłady

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

Uwagi

Użyj tego konstruktora, jeśli w pliku konfiguracji aplikacji znajduje się więcej niż jeden docelowy punkt końcowy.

Dotyczy

ChannelFactory<TChannel>(Type)

Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs

Inicjuje nowe wystąpienie klasy ChannelFactory<TChannel>.

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

Parametry

channelType
Type

Kanał Type produkowany przez fabrykę.

Wyjątki

channelType jest null.

Jest channelType to typ klasy lub wartości i nie jest interfejsem.

Uwagi

Użyj tego konstruktora, jeśli chcesz programowo przekazać informacje o typie kanału zamiast używać pliku konfiguracji aplikacji. Parametr channelType musi być interfejsem.

Dotyczy

ChannelFactory<TChannel>(Binding, EndpointAddress)

Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs

Inicjuje nowe wystąpienie ChannelFactory<TChannel> klasy z określonym powiązaniem i adresem punktu końcowego.

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)

Parametry

binding
Binding

Element Binding używany do konfigurowania punktu końcowego.

remoteAddress
EndpointAddress

Element EndpointAddress , który udostępnia lokalizację usługi.

Wyjątki

binding jest null.

Przykłady

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

Uwagi

Użyj tego konstruktora, jeśli chcesz programowo przekazać informacje o powiązaniu i adresie zamiast używać pliku konfiguracji aplikacji.

Dotyczy

ChannelFactory<TChannel>(Binding, String)

Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs
Źródło:
ChannelFactory.cs

Inicjuje nowe wystąpienie ChannelFactory<TChannel> klasy z określonym powiązaniem i adresem zdalnym.

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)

Parametry

binding
Binding

Element Binding używany do konfigurowania punktu końcowego.

remoteAddress
String

Adres, który udostępnia lokalizację usługi.

Wyjątki

Parametr remoteAddress ma wartość null.

Przykłady

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();

Uwagi

Użyj tego konstruktora, jeśli chcesz przekazać informacje o zdalnym adresie z ciągiem, a nie jako obiekt wpisany.

Dotyczy

ChannelFactory<TChannel>(String, EndpointAddress)

Inicjuje ChannelFactory<TChannel> nowe wystąpienie klasy skojarzonej z określoną nazwą konfiguracji punktu końcowego i adresu zdalnego.

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)

Parametry

endpointConfigurationName
String

Nazwa konfiguracji używana dla punktu końcowego.

remoteAddress
EndpointAddress

Element EndpointAddress , który udostępnia lokalizację usługi.

Wyjątki

endpointConfigurationName lub remoteAddress ma wartość null.

Przykłady

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

Dotyczy