TRODynamicRequest

Overview

The Dynamic Request component can be used to construct requests to a server dynamically at runtime, without the method information or a proxy object being available at compile time.

This can be done by setting up the request based on data from a RODL file, or by manually specifying the method name and defining parameters for the call in code.

Location

 

constructor Create  override

Creates a new instance.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner.

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

BeginExecute

function BeginExecute(const aCallback: TROAsyncCallback; const aUserData: Pointer): IROAsyncRequest

Parameters:

  • aCallback:
  • aUserData:

CheckProperties

Validates the dynamic request properties.

procedure CheckProperties

CreateInputComplexTypes

procedure CreateInputComplexTypes(SkipIfAssigned: boolean)

Parameters:

  • SkipIfAssigned:

DefaultNamespaces

property DefaultNamespaces: TStringList read write

EndExecute

procedure EndExecute(const aRequest: IROAsyncRequest)

Parameters:

  • aRequest:

Execute

Performs the remote request and executes the Service method on the server.

procedure Execute(aParams: TRORequestParamCollection)

Parameters:

  • aParams: Parameters

FindParam

Locates the TRORequestParam with a given name. If no parameter by that name is found, nil is returned.

function FindParam(const aParamName: string): TRORequestParam

Parameters:

  • aParamName: Name of the parameter

IsFunction

property IsFunction: boolean read write

ListServiceOperations

procedure ListServiceOperations(const aServiceName: string; aList: TStrings)

Parameters:

  • aServiceName:
  • aList:

MethodName

The name of the method to be executed on the server.

property MethodName: string read write

MethodNameChanged  protected virtual

procedure MethodNameChanged

OnAfterExecute

Fires just after the remote call has been executed (whether successfully or with an exception). You can use this event to inspect the returned Params, or to log execution.

property OnAfterExecute: TRODynamicRequestNotifyEvent read write
delegate: procedure OnAfterExecute(Sender: TRODynamicRequest)

OnBeforeExecute

Fires just before the remote call is executed. You can use this event to make last changes to the list of Params, or to log execution.

property OnBeforeExecute: TRODynamicRequestNotifyEvent read write
delegate: procedure OnBeforeExecute(Sender: TRODynamicRequest)

OnChangeMethodName

Fires when method name is changed

property OnChangeMethodName: TROStringPropertyChangeEvent read write
delegate: procedure OnChangeMethodName(Sender: TRODynamicRequest; const OldValue: string; const NewValue: string)

OnChangeServiceName

Fires when service name is changed

property OnChangeServiceName: TROStringPropertyChangeEvent read write
delegate: procedure OnChangeServiceName(Sender: TRODynamicRequest; const OldValue: string; const NewValue: string)

OnExecuteError

Fires if an exception was raised during the execution of the remote request (whether this was an exception sent back from the server, or a local one). You can use this event to inspect the raised exception, and optionally choose to not re-raise it, by setting the Ignore to true.

property OnExecuteError: TRODynamicRequestErrorEvent read write
delegate: procedure OnExecuteError(Sender: TRODynamicRequest; Error: Exception; var Ignore: boolean)

OnFindCustomTypeImplementation

property OnFindCustomTypeImplementation: TROFindCustomTypeImplementationEvent read write
delegate: procedure OnFindCustomTypeImplementation(Sender: TRODynamicRequest; const aTypeName: string; aParameter: TRORequestParam; out aImplementor: TROComplexType)

ParamByName

Locates a specific parameter, based on its name. If no matching parameter is defined, an exception will be raised.

function ParamByName(const aParamName: string): TRORequestParam

Parameters:

  • aParamName: Name of the parameter

Params

Contains the list of parameters used for the remote request, in form of a TRORequestParamCollection. Before executing the request, these parameters must be set to match the parameters expected by the server. If a RODL defining the method call is available at runtime, the CopyRODLOperation method can be used to automatically configure the parameter based on an operation defined in there.

property Params: TRORequestParamCollection read write

RefreshParams (boolean)  overload

Reloads the parameter definitions for the call. It allows to automatically retrieve the RODL from the RemoteService and locate the operation based on the MethodName.

procedure RefreshParams(aPersistValues: boolean)

Parameters:

  • aPersistValues: Allows to persist any values.

RefreshParams (TRODLOperation, boolean)  overload

Reloads the parameter definitions for the call. It allows to load the parameters from a specific RODL operation.

procedure RefreshParams(aOperation: TRODLOperation; aPersistValues: boolean)

Parameters:

  • aOperation: Operation
  • aPersistValues: Allows to persist any values.

RemoteService

Links to a TRORemoteService component that defines the service to be called.

property RemoteService: TRORemoteService read write

RODLLibrary

property RODLLibrary: TRODLLibrary read write

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned RO components.

procedure ROFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Disables destruction notification for specified RO component.

procedure RORemoveFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

 

DefaultNamespaces

property DefaultNamespaces: TStringList read write

IsFunction

property IsFunction: boolean read write

MethodName

The name of the method to be executed on the server.

property MethodName: string read write

Params

Contains the list of parameters used for the remote request, in form of a TRORequestParamCollection. Before executing the request, these parameters must be set to match the parameters expected by the server. If a RODL defining the method call is available at runtime, the CopyRODLOperation method can be used to automatically configure the parameter based on an operation defined in there.

property Params: TRORequestParamCollection read write

RemoteService

Links to a TRORemoteService component that defines the service to be called.

property RemoteService: TRORemoteService read write

RODLLibrary

property RODLLibrary: TRODLLibrary read write

 

constructor Create  override

Creates a new instance.

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner: Owner.

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

BeginExecute

function BeginExecute(const aCallback: TROAsyncCallback; const aUserData: Pointer): IROAsyncRequest

Parameters:

  • aCallback:
  • aUserData:

CheckProperties

Validates the dynamic request properties.

procedure CheckProperties

CreateInputComplexTypes

procedure CreateInputComplexTypes(SkipIfAssigned: boolean)

Parameters:

  • SkipIfAssigned:

EndExecute

procedure EndExecute(const aRequest: IROAsyncRequest)

Parameters:

  • aRequest:

Execute

Performs the remote request and executes the Service method on the server.

procedure Execute(aParams: TRORequestParamCollection)

Parameters:

  • aParams: Parameters

FindParam

Locates the TRORequestParam with a given name. If no parameter by that name is found, nil is returned.

function FindParam(const aParamName: string): TRORequestParam

Parameters:

  • aParamName: Name of the parameter

ListServiceOperations

procedure ListServiceOperations(const aServiceName: string; aList: TStrings)

Parameters:

  • aServiceName:
  • aList:

MethodNameChanged  protected virtual

procedure MethodNameChanged

ParamByName

Locates a specific parameter, based on its name. If no matching parameter is defined, an exception will be raised.

function ParamByName(const aParamName: string): TRORequestParam

Parameters:

  • aParamName: Name of the parameter

RefreshParams (boolean)  overload

Reloads the parameter definitions for the call. It allows to automatically retrieve the RODL from the RemoteService and locate the operation based on the MethodName.

procedure RefreshParams(aPersistValues: boolean)

Parameters:

  • aPersistValues: Allows to persist any values.

RefreshParams (TRODLOperation, boolean)  overload

Reloads the parameter definitions for the call. It allows to load the parameters from a specific RODL operation.

procedure RefreshParams(aOperation: TRODLOperation; aPersistValues: boolean)

Parameters:

  • aOperation: Operation
  • aPersistValues: Allows to persist any values.

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned RO components.

procedure ROFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Disables destruction notification for specified RO component.

procedure RORemoveFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

 

OnAfterExecute

Fires just after the remote call has been executed (whether successfully or with an exception). You can use this event to inspect the returned Params, or to log execution.

property OnAfterExecute: TRODynamicRequestNotifyEvent read write
delegate: procedure OnAfterExecute(Sender: TRODynamicRequest)

OnBeforeExecute

Fires just before the remote call is executed. You can use this event to make last changes to the list of Params, or to log execution.

property OnBeforeExecute: TRODynamicRequestNotifyEvent read write
delegate: procedure OnBeforeExecute(Sender: TRODynamicRequest)

OnChangeMethodName

Fires when method name is changed

property OnChangeMethodName: TROStringPropertyChangeEvent read write
delegate: procedure OnChangeMethodName(Sender: TRODynamicRequest; const OldValue: string; const NewValue: string)

OnChangeServiceName

Fires when service name is changed

property OnChangeServiceName: TROStringPropertyChangeEvent read write
delegate: procedure OnChangeServiceName(Sender: TRODynamicRequest; const OldValue: string; const NewValue: string)

OnExecuteError

Fires if an exception was raised during the execution of the remote request (whether this was an exception sent back from the server, or a local one). You can use this event to inspect the raised exception, and optionally choose to not re-raise it, by setting the Ignore to true.

property OnExecuteError: TRODynamicRequestErrorEvent read write
delegate: procedure OnExecuteError(Sender: TRODynamicRequest; Error: Exception; var Ignore: boolean)

OnFindCustomTypeImplementation

property OnFindCustomTypeImplementation: TROFindCustomTypeImplementationEvent read write
delegate: procedure OnFindCustomTypeImplementation(Sender: TRODynamicRequest; const aTypeName: string; aParameter: TRORequestParam; out aImplementor: TROComplexType)

Descendants

See Also