ChannelFactory<TChannel>.CreateChannel 메서드

정의

지정된 엔드포인트 주소에 대해 지정된 형식의 채널을 만듭니다.

오버로드

CreateChannel(Binding, EndpointAddress, Uri)

지정된 바인딩으로 구성된 지정된 전송 주소에서 서비스 엔드포인트에 메시지를 보내는 데 사용되는 지정된 형식의 채널을 만듭니다.

CreateChannel(EndpointAddress, Uri)

지정된 전송 주소를 통해 특정 엔드포인트 주소에서 서비스에 메시지를 보내는 데 사용되는 채널을 만듭니다.

CreateChannel(Binding, EndpointAddress)

지정된 바인딩으로 구성된 서비스 엔드포인트에 메시지를 보내는 데 사용되는 지정된 형식의 채널을 만듭니다.

CreateChannel(EndpointAddress)

지정된 엔드포인트 주소에서 서비스에 메시지를 보내는 데 사용되는 채널을 만듭니다.

CreateChannel()

지정된 엔드포인트 주소에 대해 지정된 형식의 채널을 만듭니다.

CreateChannel(String)

엔드포인트가 지정된 방식으로 구성된 서비스에 메시지를 보내는 데 사용되는 채널을 만듭니다.

설명

클래스의 제네릭 매개 변수인 TChannel 형식의 채널을 만듭니다.

CreateChannel(Binding, EndpointAddress, Uri)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

지정된 바인딩으로 구성된 지정된 전송 주소에서 서비스 엔드포인트에 메시지를 보내는 데 사용되는 지정된 형식의 채널을 만듭니다.

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

매개 변수

binding
Binding

엔드포인트를 구성하는 데 사용되는 Binding입니다.

endpointAddress
EndpointAddress

서비스 위치를 제공하는 EndpointAddress입니다.

via
Uri

채널에서 메시지를 보낼 전송 주소가 포함된 Uri입니다.

반환

TChannel

팩터리에서 만드는 TChannel 형식의 IChannel입니다.

예외

ChannelFactory에 지원되지 않는 이중 작업이 있는 경우

예제


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

적용 대상

CreateChannel(EndpointAddress, Uri)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

지정된 전송 주소를 통해 특정 엔드포인트 주소에서 서비스에 메시지를 보내는 데 사용되는 채널을 만듭니다.

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

매개 변수

address
EndpointAddress

서비스 위치를 제공하는 EndpointAddress입니다.

via
Uri

채널에서 메시지를 보낼 전송 주소가 포함된 Uri입니다.

반환

TChannel

팩터리에서 만드는 TChannel 형식의 IChannel입니다.

구현

예외

address이(가) null인 경우

ChannelFactory에 지원되지 않는 이중 작업이 있는 경우

예제

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

적용 대상

CreateChannel(Binding, EndpointAddress)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

지정된 바인딩으로 구성된 서비스 엔드포인트에 메시지를 보내는 데 사용되는 지정된 형식의 채널을 만듭니다.

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

매개 변수

binding
Binding

엔드포인트를 구성하는 데 사용되는 Binding입니다.

endpointAddress
EndpointAddress

서비스 위치를 제공하는 EndpointAddress입니다.

반환

TChannel

팩터리에서 만드는 TChannel 형식의 IChannel입니다.

예외

ChannelFactory에 지원되지 않는 이중 작업이 있는 경우

예제


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

적용 대상

CreateChannel(EndpointAddress)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

지정된 엔드포인트 주소에서 서비스에 메시지를 보내는 데 사용되는 채널을 만듭니다.

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

매개 변수

address
EndpointAddress

서비스 위치를 제공하는 EndpointAddress입니다.

반환

TChannel

팩터리에서 만드는 TChannel 형식의 IChannel입니다.

구현

예외

addressnull입니다.

예제

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

적용 대상

CreateChannel()

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

지정된 엔드포인트 주소에 대해 지정된 형식의 채널을 만듭니다.

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

반환

TChannel

팩터리에서 만드는 TChannel 형식의 IChannel입니다.

예제

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

설명

클래스의 제네릭 매개 변수인 TChannel 형식의 채널을 만듭니다.

적용 대상

CreateChannel(String)

Source:
ChannelFactory.cs
Source:
ChannelFactory.cs

엔드포인트가 지정된 방식으로 구성된 서비스에 메시지를 보내는 데 사용되는 채널을 만듭니다.

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

매개 변수

endpointConfigurationName
String

서비스에 사용되는 엔드포인트 구성 이름입니다.

반환

TChannel

팩터리에서 만드는 TChannel 형식의 IChannel입니다.

예외

ChannelFactory에 지원되지 않는 이중 작업이 있는 경우

예제

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

적용 대상