ChannelFactory<TChannel> Constructor (Type)

Initializes a new instance of the ChannelFactory<TChannel> class.

Namespace:  System.ServiceModel
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

protected ChannelFactory(
	Type channelType
)

Parameters

channelType
Type: System.Type
An interface that identifies the type of channel produced by the factory.

ExceptionCondition
ArgumentNullException

channelType is null.

InvalidOperationException

channelType is not an interface.

Use this constructor when you want to pass the channel type information programmatically rather than using an application configuration file.


//Create a request channel specifying a remote endpoint address
EndpointAddress address3 = new EndpointAddress("http://localhost:8000/ChannelApp");
ChannelFactory<IRequestChannel> factory3 = new ChannelFactory<IRequestChannel>("MyEndpointConfig");
factory3.CreateChannel(address3);


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: