ChannelFactory Generic Class
.NET Framework 3.0
A factory that creates channels of different types that are used by clients to send messages to variously configured service endpoints.
Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)
Assembly: System.ServiceModel (in system.servicemodel.dll)
'Declaration Public Class ChannelFactory(Of TChannel) Inherits ChannelFactory Implements IChannelFactory(Of TChannel), IChannelFactory, _ ICommunicationObject 'Usage Dim instance As ChannelFactory(Of TChannel)
J# supports the use of generic types and methods, but not the declaration of new ones.
JScript does not support generic types and methods.
Not applicable.
Type Parameters
- TChannel
The type of channel produced by the channel factory.
The following sample shows how to create a channel factory and use it to create and manage channels.
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();
System.Object
System.ServiceModel.Channels.CommunicationObject
System.ServiceModel.ChannelFactory
System.ServiceModel.ChannelFactory
System.ServiceModel.DuplexChannelFactory
System.ServiceModel.Channels.CommunicationObject
System.ServiceModel.ChannelFactory
System.ServiceModel.ChannelFactory
System.ServiceModel.DuplexChannelFactory
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: