Export (0) Print
Expand All

HttpClientChannel Class

Provides an implementation for a client channel that uses the HTTP protocol to transmit messages.

For a list of all members of this type, see HttpClientChannel Members.

System.Object
   System.Runtime.Remoting.Channels.BaseChannelObjectWithProperties
      System.Runtime.Remoting.Channels.BaseChannelWithProperties
         System.Runtime.Remoting.Channels.Http.HttpClientChannel

[Visual Basic]
Public Class HttpClientChannel
   Inherits BaseChannelWithProperties
   Implements IChannelSender, IChannel
[C#]
public class HttpClientChannel : BaseChannelWithProperties,
   IChannelSender, IChannel
[C++]
public __gc class HttpClientChannel : public
   BaseChannelWithProperties, IChannelSender, IChannel
[JScript]
public class HttpClientChannel extends BaseChannelWithProperties
   implements IChannelSender, IChannel

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

The HttpClientChannel transports messages to remote objects using the SOAP protocol. By default, all messages are passed through the SOAP formatter, where the message is changed into XML and serialized, and the required SOAP headers are added to the stream. The binary formatter can also be specified, which results in a binary data stream. The data stream is then transported to the target URI using the HTTP protocol.

Channels transport messages between applications across remoting boundaries (for example application domains, processes, and machines). These crossings include both inbound and outbound.

If there are common language runtimes at both ends of the channel, then a session is created between the two ends, to connect the client and server sink chains on either side of the boundary together. The client channel is located at the end of client context sink chain. The server channel is located at the start of the server context sink chain. Messages are delivered to the client channel, travel through it, and are received by the HttpServerChannel. The server channel then deserializes the messages and delivers them to the first server context sink.

IChannel implementations use channel configuration properties to configure the channel at run time. Channel properties can be specified in a configuration file, or programmatically, inside of an IDictionary. In a configuration file, all values are represented by strings, but when building a property IDictionary programmatically, value types can be specified with their native values or with strings.

The following table shows the channel configuration properties that can be specified for the current channel.

Property Description
name Indicates the name of the channel. This property is used to retrieve a specific channel when calling GetChannel. If this property is not set, the system defaults to "http". If you want to register more than one HttpChannel, each must have a unique name. Set this property to the Empty string ("") if you want to ignore names and avoid naming collisions. The system will allow any number of channels with the String.Empty name.
priority An integer representing the priority assigned to this channel. Higher numbers indicate a higher chance of being chosen to connect first. The default priority is 1, and negative numbers are allowed.
clientConnectionLimit An integer indicating how many connections can be simultaneously opened to a given server. The default is 2.
proxyName The name of the proxy computer.
proxyPort An integer specifying the proxy port.
machineName A string that specifies the machine name used with the current channel. Overrides the machine name specified in the channel data object.
timeout The number of milliseconds to wait before a request times out. -1 indicates an infinite timeout period.
allowAutoRedirect Gets or sets a value indicating whether the automatic handling of server redirects is enabled.
credentials Gets or sets an ICredential implementation that represents the identity of the client.
useAuthenticatedConnectionSharing A Boolean value directing the server channel to reuse authenticated connections rather than authenticate each incoming call. By default, this value is set to true if the useDefaultCredentials value is also set to true; otherwise, the value is set to false, which means that each call will be authenticated if the server requires authentication. This also applies to the programmatic equivalent, which is achieved either by creating an object that implements IDictionary, setting the "credentials" value to CredentialCache.DefaultCredentials, and passing that value to the channel sink, or by using the IDictionary returned from the ChannelServices.GetChannelSinkProperties method.

This name/value pair is supported only by version 1.1 of the .NET Framework on the following platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family.

unsafeAuthenticatedConnectionSharing A Boolean value indicating that the client will supply its own credentials and connection group name that the server should use to create an authenticated connection group. If this value is set to true, the connectionGroupName value must map to only one authenticated user. This name/value pair is ignored if the useAuthenticatedConnectionSharing value is set to true.

This name/value pair is supported only by version 1.1 of the .NET Framework on the following platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family.

connectionGroupName The name that will be used as the connection group name on the server if the unsafeAuthenticatedConnectionSharing value is also specified. This name/value pair is ignored if unsafeAuthenticatedConnectionSharing is not set to true. If specified, make sure that this name maps to only one authenticated user.

On Windows 98 and Windows Millennium Edition, there is no security ID to identify the authentication connection group name. On these platforms, therefore, there is one connection group name.If you want your application to pass an implementation of ICredentials or explicit username, password, and domain values in the HttpClientChannel properties, you can enable authentication connection sharing by also passing the unsafeAuthenticatedConnectionSharing name/value pair and the connectionGroupName name/value pair, making sure that the connectionGroupName value maps to only one authenticated user.

This name/value pair is supported only by version 1.1 of the .NET Framework on the following platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family.

Requirements

Namespace: System.Runtime.Remoting.Channels.Http

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Runtime.Remoting (in System.Runtime.Remoting.dll)

See Also

HttpClientChannel Members | System.Runtime.Remoting.Channels.Http Namespace

Show:
© 2015 Microsoft