Share via


ChannelFactory<TChannel>.CreateChannel Yöntem

Tanım

Belirtilen uç nokta adresine belirtilen türde bir kanal oluşturur.

Aşırı Yüklemeler

CreateChannel(Binding, EndpointAddress, Uri)

Belirtilen bağlama ile yapılandırılmış belirtilen aktarım adresinde bir hizmet uç noktasına ileti göndermek için kullanılan belirtilen türde bir kanal oluşturur.

CreateChannel(EndpointAddress, Uri)

Belirli bir aktarım adresi aracılığıyla belirli bir uç nokta adresinde bir hizmete ileti göndermek için kullanılan bir kanal oluşturur.

CreateChannel(Binding, EndpointAddress)

Belirtilen bağlama ile yapılandırılmış bir hizmet uç noktasına ileti göndermek için kullanılan belirtilen türde bir kanal oluşturur.

CreateChannel(EndpointAddress)

Belirli bir uç nokta adresinde bir hizmete ileti göndermek için kullanılan bir kanal oluşturur.

CreateChannel()

Belirtilen uç nokta adresine belirtilen türde bir kanal oluşturur.

CreateChannel(String)

Uç noktası belirtilen şekilde yapılandırılmış bir hizmete ileti göndermek için kullanılan bir kanal oluşturur.

Açıklamalar

Sınıfın genel parametresi olan türünde TChannelbir kanal oluşturur.

CreateChannel(Binding, EndpointAddress, Uri)

Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs

Belirtilen bağlama ile yapılandırılmış belirtilen aktarım adresinde bir hizmet uç noktasına ileti göndermek için kullanılan belirtilen türde bir kanal oluşturur.

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

Parametreler

binding
Binding

Binding Uç noktayı yapılandırmak için kullanılır.

endpointAddress
EndpointAddress

Hizmetin EndpointAddress konumunu sağlayan.

via
Uri

Kanalın Uri ileti gönderdiği aktarım adresini içeren.

Döndürülenler

TChannel

TChannel Fabrika tarafından oluşturulan türüIChannel.

Özel durumlar

desteklemediği ChannelFactory çift yönlü işlemlere sahiptir.

Örnekler


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

Şunlara uygulanır

CreateChannel(EndpointAddress, Uri)

Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs

Belirli bir aktarım adresi aracılığıyla belirli bir uç nokta adresinde bir hizmete ileti göndermek için kullanılan bir kanal oluşturur.

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

Parametreler

address
EndpointAddress

Hizmetin EndpointAddress konumunu sağlayan.

via
Uri

Kanalın Uri ileti gönderdiği aktarım adresini içeren.

Döndürülenler

TChannel

TChannel Fabrika tarafından oluşturulan türüIChannel.

Uygulamalar

Özel durumlar

address, null değeridir.

desteklemediği ChannelFactory çift yönlü işlemlere sahiptir.

Örnekler

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

Şunlara uygulanır

CreateChannel(Binding, EndpointAddress)

Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs

Belirtilen bağlama ile yapılandırılmış bir hizmet uç noktasına ileti göndermek için kullanılan belirtilen türde bir kanal oluşturur.

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

Parametreler

binding
Binding

Binding Uç noktayı yapılandırmak için kullanılır.

endpointAddress
EndpointAddress

Hizmetin EndpointAddress konumunu sağlayan.

Döndürülenler

TChannel

TChannel Fabrika tarafından oluşturulan türüIChannel.

Özel durumlar

desteklemediği ChannelFactory çift yönlü işlemlere sahiptir.

Örnekler


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

Şunlara uygulanır

CreateChannel(EndpointAddress)

Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs

Belirli bir uç nokta adresinde bir hizmete ileti göndermek için kullanılan bir kanal oluşturur.

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

Parametreler

address
EndpointAddress

Hizmetin EndpointAddress konumunu sağlayan.

Döndürülenler

TChannel

TChannel Fabrika tarafından oluşturulan türüIChannel.

Uygulamalar

Özel durumlar

address, null değeridir.

Örnekler

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

Şunlara uygulanır

CreateChannel()

Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs

Belirtilen uç nokta adresine belirtilen türde bir kanal oluşturur.

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

Döndürülenler

TChannel

TChannel Fabrika tarafından oluşturulan türüIChannel.

Örnekler

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

Açıklamalar

Sınıfın genel parametresi olan türünde TChannelbir kanal oluşturur.

Şunlara uygulanır

CreateChannel(String)

Kaynak:
ChannelFactory.cs
Kaynak:
ChannelFactory.cs

Uç noktası belirtilen şekilde yapılandırılmış bir hizmete ileti göndermek için kullanılan bir kanal oluşturur.

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

Parametreler

endpointConfigurationName
String

Hizmet için kullanılan uç nokta yapılandırmasının adı.

Döndürülenler

TChannel

TChannel Fabrika tarafından oluşturulan türüIChannel.

Özel durumlar

desteklemediği ChannelFactory çift yönlü işlemlere sahiptir.

Örnekler

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

Şunlara uygulanır