ChannelFactory<TChannel>.CreateChannel Metoda

Definicja

Tworzy kanał określonego typu do określonego adresu punktu końcowego.

Przeciążenia

CreateChannel(Binding, EndpointAddress, Uri)

Tworzy kanał określonego typu, który jest używany do wysyłania komunikatów do punktu końcowego usługi pod określonym adresem transportu skonfigurowanym przy użyciu określonego powiązania.

CreateChannel(EndpointAddress, Uri)

Tworzy kanał używany do wysyłania komunikatów do usługi pod określonym adresem punktu końcowego za pośrednictwem określonego adresu transportu.

CreateChannel(Binding, EndpointAddress)

Tworzy kanał określonego typu, który jest używany do wysyłania komunikatów do punktu końcowego usługi skonfigurowanego przy użyciu określonego powiązania.

CreateChannel(EndpointAddress)

Tworzy kanał używany do wysyłania komunikatów do usługi pod określonym adresem punktu końcowego.

CreateChannel()

Tworzy kanał określonego typu do określonego adresu punktu końcowego.

CreateChannel(String)

Tworzy kanał służący do wysyłania komunikatów do usługi, której punkt końcowy jest skonfigurowany w określony sposób.

Uwagi

Tworzy kanał typu TChannel, parametr ogólny dla klasy .

CreateChannel(Binding, EndpointAddress, Uri)

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

Tworzy kanał określonego typu, który jest używany do wysyłania komunikatów do punktu końcowego usługi pod określonym adresem transportu skonfigurowanym przy użyciu określonego powiązania.

public:
 static TChannel CreateChannel(System::ServiceModel::Channels::Binding ^ binding, System::ServiceModel::EndpointAddress ^ endpointAddress, Uri ^ via);
public static TChannel CreateChannel (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress endpointAddress, Uri via);
static member CreateChannel : System.ServiceModel.Channels.Binding * System.ServiceModel.EndpointAddress * Uri -> 'Channel
Public Shared Function CreateChannel (binding As Binding, endpointAddress As EndpointAddress, via As Uri) As TChannel

Parametry

binding
Binding

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

endpointAddress
EndpointAddress

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

via
Uri

Element Uri zawierający adres transportu, do którego kanał wysyła komunikaty.

Zwraca

TChannel

Typ TChannelIChannel utworzony przez fabrykę.

Wyjątki

Ma ChannelFactory operacje dwukierunkowe, które nie obsługują.

Przykłady


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

 IRequestChannel channel =
ChannelFactory<IRequestChannel>.CreateChannel(binding, address, uri);
 channel.Open();
class Program : ChannelFactory<IService1Channel>
{
    static void Main(string[] args)
    {
        IService1Channel channel = CreateChannel("BasicHttpBinding_IService1");
        channel.Open();

        channel.Close();
    }
}

Dotyczy

CreateChannel(EndpointAddress, Uri)

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

Tworzy kanał używany do wysyłania komunikatów do usługi pod określonym adresem punktu końcowego za pośrednictwem określonego adresu transportu.

public:
 virtual TChannel CreateChannel(System::ServiceModel::EndpointAddress ^ address, Uri ^ via);
public virtual TChannel CreateChannel (System.ServiceModel.EndpointAddress address, Uri via);
abstract member CreateChannel : System.ServiceModel.EndpointAddress * Uri -> 'Channel
override this.CreateChannel : System.ServiceModel.EndpointAddress * Uri -> 'Channel
Public Overridable Function CreateChannel (address As EndpointAddress, via As Uri) As TChannel

Parametry

address
EndpointAddress

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

via
Uri

Element Uri zawierający adres transportu, do którego kanał wysyła komunikaty.

Zwraca

TChannel

Typ TChannelIChannel utworzony przez fabrykę.

Implementuje

Wyjątki

address to null.

Ma ChannelFactory operacje dwukierunkowe, które nie obsługują.

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

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

Dotyczy

CreateChannel(Binding, EndpointAddress)

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

Tworzy kanał określonego typu, który jest używany do wysyłania komunikatów do punktu końcowego usługi skonfigurowanego przy użyciu określonego powiązania.

public:
 static TChannel CreateChannel(System::ServiceModel::Channels::Binding ^ binding, System::ServiceModel::EndpointAddress ^ endpointAddress);
public static TChannel CreateChannel (System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress endpointAddress);
static member CreateChannel : System.ServiceModel.Channels.Binding * System.ServiceModel.EndpointAddress -> 'Channel
Public Shared Function CreateChannel (binding As Binding, endpointAddress As EndpointAddress) As TChannel

Parametry

binding
Binding

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

endpointAddress
EndpointAddress

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

Zwraca

TChannel

Typ TChannelIChannel utworzony przez fabrykę.

Wyjątki

Ma ChannelFactory operacje dwukierunkowe, które nie obsługują.

Przykłady


       EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
       IRequestChannel channel = ChannelFactory<IRequestChannel>.CreateChannel(binding, address);
       channel.Open();

Dotyczy

CreateChannel(EndpointAddress)

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

Tworzy kanał używany do wysyłania komunikatów do usługi pod określonym adresem punktu końcowego.

public:
 virtual TChannel CreateChannel(System::ServiceModel::EndpointAddress ^ address);
public TChannel CreateChannel (System.ServiceModel.EndpointAddress address);
abstract member CreateChannel : System.ServiceModel.EndpointAddress -> 'Channel
override this.CreateChannel : System.ServiceModel.EndpointAddress -> 'Channel
Public Function CreateChannel (address As EndpointAddress) As TChannel

Parametry

address
EndpointAddress

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

Zwraca

TChannel

Typ TChannelIChannel utworzony przez fabrykę.

Implementuje

Wyjątki

address to null.

Przykłady

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

Dotyczy

CreateChannel()

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

Tworzy kanał określonego typu do określonego adresu punktu końcowego.

public:
 TChannel CreateChannel();
public TChannel CreateChannel ();
member this.CreateChannel : unit -> 'Channel
Public Function CreateChannel () As TChannel

Zwraca

TChannel

Typ TChannelIChannel utworzony przez fabrykę.

Przykłady

IChannelFactory<IRequestChannel> factory = binding.BuildChannelFactory<IRequestChannel>(bindingParams);
factory.Open();
EndpointAddress address = new EndpointAddress("http://localhost:8000/ChannelApp");
IRequestChannel channel = factory.CreateChannel(address);
channel.Open();

Uwagi

Tworzy kanał typu TChannel, parametr ogólny dla klasy .

Dotyczy

CreateChannel(String)

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

Tworzy kanał służący do wysyłania komunikatów do usługi, której punkt końcowy jest skonfigurowany w określony sposób.

protected:
 static TChannel CreateChannel(System::String ^ endpointConfigurationName);
protected static TChannel CreateChannel (string endpointConfigurationName);
static member CreateChannel : string -> 'Channel
Protected Shared Function CreateChannel (endpointConfigurationName As String) As TChannel

Parametry

endpointConfigurationName
String

Nazwa konfiguracji punktu końcowego używanego dla usługi.

Zwraca

TChannel

Typ TChannelIChannel utworzony przez fabrykę.

Wyjątki

Ma ChannelFactory operacje dwukierunkowe, które nie obsługują.

Przykłady

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

    ChannelFactory<IRequestChannel> factory =
        new ChannelFactory<IRequestChannel>(binding, address);

    IRequestChannel channel = factory.CreateChannel();
    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();
}

Dotyczy