TROWinInetHTTPChannel Class

From RemObjects Wiki
Jump to: navigation, search

This is a Library topic for RemObjects SDK for Delphi
This page is generated from external data, please do not update

InterfacesClassesAliasesImplements

Contents

Overview

TROWinInetHTTPChannel implements an HTTP based channel that uses the WinInet HTTP implementation provided by the Windows operating system.

The channel will automatically make use of options such as proxy and firewall settings, and the online/offline state configured for Internet Explorer or using the Internet Control Panel. It is the most commonly used and recommended HTTP channel.


Location

uROWinInetHttpChannel.pas

  • Ancestry: TROBaseHTTPChannel | TROWinInetHTTPChannel


Properties

AccessType

Type of access required. This parameter can be one of the following values:

  • atDirect = Resolves all host names locally.
  • atProxy = Retrieves the proxy or direct configuration from the registry.
  • atPreconfig_with_no_autoproxy = Retrieves the proxy or direct configuration from the registry and prevents the use of a startup Microsoft JScript or Internet Setup (INS) file.
  • atPreconfig = Passes requests to the proxy unless a proxy bypass list is supplied and the name to be resolved bypasses the proxy.



property AccessType: TROWinInetAccessType read write


AttemptToConnect



property AttemptToConnect: Boolean read write


Busy     (declared in TROTransportChannel)

Informs whether the channel is currently busy executing a remote request (true) or not (false). Most channels (except most notably the TROSuperTCPChannel) are only capable of performing one request at a time; if a second request is attempted while the channel is Busy, an EROChannelBusy exception will be raised.



property Busy: boolean read


ClientCert



property ClientCert: TROWinInetClientCert read write


Connected



property Connected: boolean read write


CurrentLocator     (declared in TROTransportChannel)

Returns which of the fail-over/load balancing servers configured in the ServerLocators is currently active. Depending on the DispatchOptions defined, this value might change with each request, or only if the current server fails.



property CurrentLocator: TROServerLocator read write


DispatchOptions     (declared in TROTransportChannel)

Configures the available fail-over and load balancing options provided by the RemObjects SDK. By default, channels are set up to talk to one specific server only. Two independent options are available to provide fail-over and load balancing:

  • Enables fail-over support. If the connection to any given server fails, the channel will automatically keep trying the next server specified in ServerLocators, until a working server is found or all servers have been tried.
  • Enables load-balancing support. Each request dispatched through the channel will go to a different server configured in ServerLocators, resulting in calls being more or less equally distributed over the available servers.

Enabling any of these options obviously requires the server to be implemented in a stateless way, so that it does not depend on all requests from a client going to the same server. This implies using a class factory different from Per-Client and, if sessions are used, a session manager that allows sharing of session state between servers.



property DispatchOptions: TRODispatchOptions read write


Encryption obsolete     (declared in TROBaseConnection)

This is DES based enscryption, it is obsolete because works only for Delphi. Use message envelope AES Encryption Envelope instead.



property Encryption: TROEncryption read write


FaultToleranceLocatorIdx     (declared in TROTransportChannel)



property FaultToleranceLocatorIdx: integer read write


InetConnect



property InetConnect: HINTERNET read


InetRoot



property InetRoot: HINTERNET read


InitializeAutoProxy

Merely refreshes the internal state of proxy configuration information from the registry. There may be a small delay if you are using this.



property InitializeAutoProxy: Boolean read write


KeepConnection

This property specifies can we reuse the same TCP connection to send and receive multiple HTTP requests/responses or not. If it set to False then each pair request/response creates new one connection. Uses KeepConnection = True allows to improve HTTP performance for multiple requests.



property KeepConnection: boolean read write


LoadBalancerLocatorIdx     (declared in TROTransportChannel)



property LoadBalancerLocatorIdx: Integer read write


Login

Defines the username and password that should be used to authenticate with the server. This login is used for HTTP level authentication only. It should be set if your web server (or proxy server) is configured to require login at HTTP level to accept communication. This is not to be confused with the RemObjects SDK's own login on session level, as discussed in Login and Authentication.



property Login: TROLogin read write


ProbeFrequency     (declared in TROTransportChannel)

Sets at what intervals, in milliseconds, the channel will probe the servers configured in ServerLocators for availability. The default value is 60,000 (60 seconds). See the ProbeServers property for a more detailed description. Although somewhat misnamed, this property defines the Interval between probes, not the actual probing Frequency. The property name is persisted for backward compatibility.



property ProbeFrequency: cardinal read write


ProbeServers     (declared in TROTransportChannel)

Toggles whether the channel will continuously probe the servers configured in ServerLocators for availability. If enabled (true), the channel will ping all servers at a regular interval to determine if they are reachable. If a server fails to respond, it will be disabled for future calls until a later probe can reach it again. The interval between probes can be configured using the ProbeFrequency property. By default, server probing is turned off.



property ProbeServers: boolean read write


ProxyLogin

Defines the username and password that should be used to authenticate with the proxy.



property ProxyLogin: TROLogin read write


ServerLocators     (declared in TROTransportChannel)

Optionally, this collection property can be filled to contain a list of possible servers to be used for fail-over or load balancing purposes. Depending on the settings configured in DispatchOptions, the channel will automatically spread calls over the available servers, or fall back to another server if one fails.



property ServerLocators: TROServerLocatorCollection read write


StoreConnected

This property specifies does Connected property should be stored in the dfm file or not.



property StoreConnected: boolean read write


SuppressErrorDialogs



property SuppressErrorDialogs: boolean read write


SynchronizedProbing     (declared in TROTransportChannel)

Determines whether server probing happens in the context of the main VCL thread (true, default) or in a background worker thread. See the ProbeServers property for a more detailed description.



property SynchronizedProbing: Boolean read write


TargetUri     (declared in TROTransportChannel)



property TargetUri: TROUri read write


TargetUrl   protected     (declared in TROTransportChannel)



property TargetUrl: string read write


ThreadSafe   protected     (declared in TROTransportChannel)



property ThreadSafe: Boolean read write


Timeout

Sets the timeout, in milliseconds, after which a request will be aborted if no response has been received. The default value is 600,000 (10 minutes). If you are expecting long processing times on your server, make sure to adjust this timeout accordingly.



property Timeout: Integer read write


TrustInvalidCA



property TrustInvalidCA: Boolean read write


Class Methods

ChannelMatchingTargetUri     (declared in TROTransportChannel)



function ChannelMatchingTargetUri(const aUri: TROUri): TROTransportChannel


Parameters:

  • aUri:


ChannelMatchingTargetUrl     (declared in TROTransportChannel)



function ChannelMatchingTargetUrl(const aUrl: string): TROTransportChannel


Parameters:

  • aUrl:


Instance Methods

constructor Create   override



constructor Create(AOwner: TComponent)


Parameters:

  • AOwner:


destructor Destroy   override



destructor Destroy


Assign   override



procedure Assign(aSource: TPersistent)


Parameters:

  • aSource:


AsyncException   protected virtual     (declared in TROTransportChannel)



procedure AsyncException(aAsyncInterface: IROAsyncInterface; AsyncException: Exception)


Parameters:

  • aAsyncInterface:
  • AsyncException:


BeforeDispatch   protected virtual     (declared in TROTransportChannel)



procedure BeforeDispatch(aMessage: IROMessage)


Parameters:

  • aMessage:


ChangeServerLocator   protected virtual     (declared in TROTransportChannel)



procedure ChangeServerLocator(var faultstartlocatoridx: integer; var aRetry: Boolean; const aException: Exception)


Parameters:

  • faultstartlocatoridx:
  • aRetry:
  • aException:


CheckProperties   virtual     (declared in TROTransportChannel)



procedure CheckProperties


DecodeEventStream   protected     (declared in TROTransportChannel)



procedure DecodeEventStream(const aStream: TStream)


Parameters:

  • aStream:


Dispatch (IROMessage)   protected reintroduce overload     (declared in TROTransportChannel)



procedure Dispatch(aMessage: IROMessage)


Parameters:

  • aMessage:


DoAfterEncryptEvent   protected virtual obsolete     (declared in TROBaseConnection)



procedure DoAfterEncryptEvent(aEncryptedStream: TStream)


Parameters:

  • aEncryptedStream:


DoAfterProbingServerEvent   protected virtual     (declared in TROTransportChannel)



procedure DoAfterProbingServerEvent(const aServerLocator: TROServerLocator; const Failed: Boolean)


Parameters:

  • aServerLocator:
  • Failed:


DoAfterProbingServersEvent   protected virtual     (declared in TROTransportChannel)



procedure DoAfterProbingServersEvent(const ProbedCount: integer; const EnabledCount: integer; const DisabledCount: integer)


Parameters:

  • ProbedCount:
  • EnabledCount:
  • DisabledCount:


DoBeforeDecryptEvent   protected virtual obsolete     (declared in TROBaseConnection)



procedure DoBeforeDecryptEvent(aEncryptedStream: TStream)


Parameters:

  • aEncryptedStream:


DoBeforeProbingServerEvent   protected virtual     (declared in TROTransportChannel)



procedure DoBeforeProbingServerEvent(const aServerLocator: TROServerLocator)


Parameters:

  • aServerLocator:


DoBeforeProbingServersEvent   protected virtual     (declared in TROTransportChannel)



procedure DoBeforeProbingServersEvent


DoDecryption   virtual obsolete     (declared in TROBaseConnection)



procedure DoDecryption(iCipherText: TStream; iPlainText: TStream)


Parameters:

  • iCipherText:
  • iPlainText:


DoDecryption2 obsolete     (declared in TROBaseConnection)



procedure DoDecryption2(const iStream: TStream)


Parameters:

  • iStream:


DoEncryption   virtual obsolete     (declared in TROBaseConnection)



procedure DoEncryption(iPlainText: TStream; iCipherText: TStream)


Parameters:

  • iPlainText:
  • iCipherText:


DoEncryption2 obsolete     (declared in TROBaseConnection)



procedure DoEncryption2(const iStream: TStream)


Parameters:

  • iStream:


DoException   protected virtual     (declared in TROTransportChannel)



procedure DoException(anException: Exception; var aRetry: Boolean)


Parameters:

  • anException:
  • aRetry:


DoLoginNeeded   protected virtual     (declared in TROTransportChannel)



procedure DoLoginNeeded(anException: Exception; var aRetry: Boolean)


Parameters:

  • anException:
  • aRetry:


DoReceiveStreamEvent   protected virtual     (declared in TROTransportChannel)



procedure DoReceiveStreamEvent(const aStream: TStream)


Parameters:

  • aStream:


DoSendStreamEvent   protected virtual     (declared in TROTransportChannel)



procedure DoSendStreamEvent(const aStream: TStream)


Parameters:

  • aStream:


DoServerLocatorAssignmentEvent   protected virtual     (declared in TROTransportChannel)



procedure DoServerLocatorAssignmentEvent(const aLocator: TROServerLocator; const aException: Exception)


Parameters:

  • aLocator:
  • aException:


GetContentType   protected override



function GetContentType: string


GetKeepAlive   protected override



function GetKeepAlive: Boolean


GetServerLocatorClass   protected virtual     (declared in TROTransportChannel)



function GetServerLocatorClass: TROServerLocatorClass


GetTargetUri   protected virtual     (declared in TROTransportChannel)



function GetTargetUri: TROUri


GetTargetUrl   protected virtual     (declared in TROTransportChannel)



function GetTargetUrl: string


GetTransportObject   protected virtual abstract     (declared in TROTransportChannel)



function GetTransportObject: TObject


InitServerLocator   protected virtual     (declared in TROTransportChannel)



function InitServerLocator: Integer


intChangeServerLocator   protected     (declared in TROTransportChannel)



procedure intChangeServerLocator(var faultstartlocatoridx: integer; var aRetry: Boolean; const aException: Exception)


Parameters:

  • faultstartlocatoridx:
  • aRetry:
  • aException:


IntDispatch   protected override



procedure IntDispatch(aRequest: TStream; aResponse: TStream)


Parameters:

  • aRequest:
  • aResponse:


intInitServerLocator   protected     (declared in TROTransportChannel)



function intInitServerLocator: Integer


IntSetServerLocator   protected virtual     (declared in TROTransportChannel)



procedure IntSetServerLocator(aServerLocator: TROServerLocator)


Parameters:

  • aServerLocator:


IsEncryptionUsed   protected     (declared in TROTransportChannel)



function IsEncryptionUsed: Boolean


Loaded   protected override     (declared in TROTransportChannel)



procedure Loaded


Notification   protected override     (declared in TROComponent)



procedure Notification(AComponent: TComponent; Operation: TOperation)


Parameters:

  • AComponent:
  • Operation:


Probe   protected     (declared in TROTransportChannel)



function Probe(aServerLocator: TROServerLocator): boolean


Parameters:

  • aServerLocator:


ProbeAll   protected     (declared in TROTransportChannel)



procedure ProbeAll


ResetProbingClone   protected virtual     (declared in TROTransportChannel)



procedure ResetProbingClone(aProbe: TROTransportChannel)


Parameters:

  • aProbe:


RetrieveMetadata   protected virtual     (declared in TROTransportChannel)



procedure RetrieveMetadata(out Metadata: TStream)


Parameters:

  • Metadata:


RetrieveRODL   protected     (declared in TROTransportChannel)



procedure RetrieveRODL(out RODLLibrary: TRODLLibrary)


Parameters:

  • RODLLibrary:


ROFreeNotification     (declared in TROComponent)



procedure ROFreeNotification(AComponent: TComponent)


Parameters:

  • AComponent:


RORemoveFreeNotification     (declared in TROComponent)



procedure RORemoveFreeNotification(AComponent: TComponent)


Parameters:

  • AComponent:


SendRemoveNotification   protected     (declared in TROComponent)



procedure SendRemoveNotification(AComponent: TComponent)


Parameters:

  • AComponent:


SetContentType   protected override



procedure SetContentType(const aValue: string)


Parameters:

  • aValue:


SetKeepAlive   protected override



procedure SetKeepAlive(const Value: Boolean)


Parameters:

  • Value:


SetServerLocator   protected     (declared in TROTransportChannel)



procedure SetServerLocator(aServerLocator: TROServerLocator; anException: Exception)


Parameters:

  • aServerLocator:
  • anException:


SetTargetUri   protected override



procedure SetTargetUri(const aUri: TROUri)


Parameters:

  • aUri:


SetTargetUrl   protected virtual     (declared in TROTransportChannel)



procedure SetTargetUrl(const aValue: string)


Parameters:

  • aValue:


TriggerAfterConnect   protected



procedure TriggerAfterConnect


TriggerProgress   protected virtual     (declared in TROTransportChannel)



procedure TriggerProgress(iType: TProgressType; iDirection: TProgressDirection; iTransfered: integer; iTotal: integer)


Parameters:

  • iType:
  • iDirection:
  • iTransfered:
  • iTotal:


Events

AfterConnect



property AfterConnect: TNotifyEvent read write


OnAfterAttemptConnect



property OnAfterAttemptConnect: TAfterAttemptConnectEvent read write delegate: procedure Invoke(Sender: TObject; var aAttemptConnectResult: DWORD)


onAfterEncrypt obsolete     (declared in TROBaseConnection)



property onAfterEncrypt: TROBaseConnectionOperation read write delegate: procedure Invoke(Sender: TROBaseConnection; aEncryptedStream: TStream)


OnAfterOpenRequest



property OnAfterOpenRequest: TWinInetAfterOpenRequestEvent read write delegate: procedure Invoke(Sender: TObject; aHandle: HINTERNET)


OnAfterProbingServer     (declared in TROTransportChannel)

Fires after the channel is done probing a specific server for availability. You can use this event to check the result of the probing, possibly to update internal data structures or to display server status in the user interface.



property OnAfterProbingServer: TROEndProbeServerEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; aServerLocator: TROServerLocator; Failed: boolean)


OnAfterProbingServers     (declared in TROTransportChannel)

Fires after the channel is done probing all servers for availability. You can use this event to check the result of the probing, possibly to update internal data structures or to display server status in the user interface.



property OnAfterProbingServers: TROEndProbeServersEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; ProbedCount: integer; EnabledCount: integer; DisabledCount: integer)


OnAsyncException     (declared in TROTransportChannel)



property OnAsyncException: TROAsyncExceptionEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; Async: IROAsyncInterface; anException: Exception)


onBeforeDecrypt obsolete     (declared in TROBaseConnection)



property onBeforeDecrypt: TROBaseConnectionOperation read write delegate: procedure Invoke(Sender: TROBaseConnection; aEncryptedStream: TStream)


OnBeforeOpenConnection



property OnBeforeOpenConnection: TNotifyEvent read write


OnBeforeOpenRequest



property OnBeforeOpenRequest: TNotifyEvent read write


OnBeforeProbingServer     (declared in TROTransportChannel)

Fires before the channel starts probing a specific server for availability. You can use this event to:

  • check or adjust the server configuration
  • to include/exclude the server from being probed by changing the TROServerLocator.Enabled property.



property OnBeforeProbingServer: TROBeginProbeServerEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; aServerLocator: TROServerLocator)


OnBeforeProbingServers     (declared in TROTransportChannel)

Fires before the channel starts probing all servers for availability. You can use this event:

  • to check or adjust the server configurations
  • to include/exclude individual server from being probed by changing their TROServerLocator.Enabled properties.



property OnBeforeProbingServers: TROBeginProbeServersEvent read write delegate: procedure Invoke(Sender: TROTransportChannel)


OnException     (declared in TROTransportChannel)

Fires if an exception is raised during the execution of a remote request. This could be an exception returned from the server, a communication problem or an error within the client. Depending on the type of error, your event handler can try to rectify the problem, and set aRetry to true to have the channel try and perform the request again. For example, an application could show a dialog asking the user to confirm if his internet connection is available, with Cancel and Retry buttons. If aRetry is set to true and the call succeeds at the second attempt, the call will return to the original code that initiated the request, as if the exception never happened.



property OnException: TROExceptionEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; anException: Exception; var aRetry: Boolean)


OnFailure     (declared in TROTransportChannel)



property OnFailure: TROExceptionEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; anException: Exception; var aRetry: Boolean)


OnInvalidCertificate



property OnInvalidCertificate: TROInvalidCertificate read write delegate: procedure Invoke(Sender: TObject; const aIssuer: AnsiString; const aSubject: AnsiString; var aAllow: Boolean)


OnLoginNeeded     (declared in TROTransportChannel)

Fires if an EROSessionNotFound (or the descendant SessionNotFoundException) exception is raised during the execution of a remote request. This usually indicates that the server cannot authenticate the client or that the session has expired. The most common use for this event is to perform a call to a special Login service provided by the server (possibly after prompting the user to enter username and password), and to set the aRetry parameter to true if login was successful.



property OnLoginNeeded: TROExceptionEvent read write delegate: procedure Invoke(Sender: TROTransportChannel; anException: Exception; var aRetry: Boolean)


OnProgress     (declared in TROTransportChannel)

This event fires as the channel is transferring data for a request or response to or from the server, informing of the current progress. It can be used to keep the user interface updated during lengthy transfers,e.g. by showing a progress bar or the remaining transfer volume. Note: the accuracy and frequency of calls to OnProgress depends on the channel type; since channels transport data packets in different sized chunks (or even all-at-once), OnProgress might show a very fine progress for some channels, while jumping from 0 to 100% in one step with others.



property OnProgress: TProgressEvent read write delegate: procedure Invoke(iSender: TObject; iType: TProgressType; iDirection: TProgressDirection; iTransferred: integer; iTotal: integer)


OnReceiveStream     (declared in TROTransportChannel)

Fires after a stream with a response message has been received from the server. Use this event handler to inspect and possibly modify the stream, before it continues to be processed by the higher levels of the RemObjects SDK framework.



property OnReceiveStream: TStreamDispatch read write delegate: procedure Invoke(aStream: TStream)


OnSendStream     (declared in TROTransportChannel)

Fires just as a stream with a request message will be sent to the server. The event handler can inspect and possibly modify the stream, before it continues to be sent off to the server.



property OnSendStream: TStreamDispatch read write delegate: procedure Invoke(aStream: TStream)


OnServerLocatorAssignment     (declared in TROTransportChannel)

Fires before changing of a server locator



property OnServerLocatorAssignment: TServerLocatorAssignment read write delegate: procedure Invoke(Sender: TROTransportChannel; aLocator: TROServerLocator; aException: Exception)


See Also


Product: RemObjects SDK
Available Editions: RemObjects SDK for .NET, Xcode, Delphi, Java and JavaScript

GlossaryArticlesLibrarySamples

Personal tools
Namespaces

Variants
Actions
Navigation
products
platforms
special
Toolbox