DynamicRequest
Overview
The DynamicRequest class represents a request (ie remote method call), that can be made to a service on a Remoting SDK Server.
In contrast to making calls in code that use the services imported interfaces, Dynamic Request allows you to make calls to services whose exact definition is not known at compile time.
The service to be called into is identified by referenced RemoteService instance, while the service method to be called is defined through the MethodName and Parameters properties.
Once a call has been set up and the required parameter values have been specified, the call can be executed by calling the MakeRequest method.
Location
- Reference: RemObjects.SDK.dll
- Namespace: RemObjects.SDK
- Ancestry: Component | DynamicRequest
constructor
Creates a new instance of the DynamicRequest class.
constructor
DynamicRequest()
Sub New()
constructor (IContainer)
Creates a new instance of the DynamicRequest class and adds it to the providec components collection.
constructor(container: IContainer)
DynamicRequest(IContainer container)
Sub New(container As IContainer)
Parameters:
- container: Components collection
constructor (String, RemoteService)
Creates a new instance of the DynamicRequest class and sets its MethodName and RemoteService properties.
constructor(methodName: String; remoteService: RemoteService)
DynamicRequest(String methodName, RemoteService remoteService)
Sub New(methodName As String, remoteService As RemoteService)
Parameters:
- methodName: Remote method name
- remoteService: RemoteService class instance identifying the remote service
constructor (String, RemoteService, array of DynamicRequestParameter)
Creates a new instance of the DynamicRequest class and sets its MethodName, RemoteService and Parameters properties.
constructor(methodName: String; remoteService: RemoteService; parameters: array of DynamicRequestParameter)
DynamicRequest(String methodName, RemoteService remoteService, DynamicRequestParameter[] parameters)
Sub New(methodName As String, remoteService As RemoteService, parameters As DynamicRequestParameter())
Parameters:
- methodName: Remote method name
- remoteService: RemoteService class instance identifying the remote service
- parameters: Parameters of the remote method call
constructor (String, RemoteService, DynamicRequestParameterCollection)
Creates a new instance of the DynamicRequest class and sets its MethodName, RemoteService and Parameters properties.
constructor(methodName: String; remoteService: RemoteService; parameters: DynamicRequestParameterCollection)
DynamicRequest(String methodName, RemoteService remoteService, DynamicRequestParameterCollection parameters)
Sub New(methodName As String, remoteService As RemoteService, parameters As DynamicRequestParameterCollection)
Parameters:
- methodName: Remote method name
- remoteService: RemoteService class instance identifying the remote service
- parameters: Parameters of the remote method call
constructor (String, RemoteService, IList<DynamicRequestParameter>)
Creates a new instance of the DynamicRequest class and sets its MethodName, RemoteService and Parameters properties.
constructor(methodName: String; remoteService: RemoteService; parameters: IList<DynamicRequestParameter>)
DynamicRequest(String methodName, RemoteService remoteService, IList<DynamicRequestParameter> parameters)
Sub New(methodName As String, remoteService As RemoteService, parameters As IList<DynamicRequestParameter>)
Parameters:
- methodName: Remote method name
- remoteService: RemoteService class instance identifying the remote service
- parameters: Parameters of the remote method call
BeginMakeRequest
Asynchronously starts request to the remote service.
method BeginMakeRequest(cb: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginMakeRequest(AsyncCallback cb, Object state)
Function BeginMakeRequest(cb As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- cb: Callback method that will be called once the asynchronous operation is completed
- state: Asynchronous operation state object
EndMakeRequest
Finishes the asynchronous request to the remote service.
method EndMakeRequest(ar: IAsyncResult)
void EndMakeRequest(IAsyncResult ar)
Sub EndMakeRequest(ar As IAsyncResult)
Parameters:
- ar: Object representing the status of an asynchronous operation
MakeRequest
Performs the actual request to the remote service.
method MakeRequest
void MakeRequest()
Sub MakeRequest()
MethodName
Gets or sets the the name of the remote service method to call.
Note: If the RemoteService property is assigned and the server is available at design time, you can select the method name from a list of available methods in the Property Browser's drop down box. When doing this, the Parameters collection will automatically be populated as well.
property MethodName: String read write;
String MethodName { get; set; }
Property MethodName() As String
ParameterByName
Returns the DynamicRequestParameter with the given name.
This method can be used to populate all parameters with their values without relying on their ordering.
method ParameterByName(parameterName: String): DynamicRequestParameter
DynamicRequestParameter ParameterByName(String parameterName)
Function ParameterByName(parameterName As String) As DynamicRequestParameter
Parameters:
- parameterName: Parameter name
Parameters
Gets collection of the parameters that will be passed into and out of the method call.
For the method call call to succeed these parameters have to exactly match the parameters defined for the service method on the server side.
The UpdateParamsFromRodl and UpdateParamsFromRodlOperation methods can be used to populate the parameters automatically. Once the parameters are defined they an be accessed using the ParameterByName method.
Note: If the RemoteService property is assigned and the server is available at design time, you can select the method name from a list of available methods in the Property Browser's drop down box. When doing this, the Parameters collection will automatically be populated as well.
property Parameters: DynamicRequestParameterCollection read;
DynamicRequestParameterCollection Parameters { get; }
ReadOnly Property Parameters() As DynamicRequestParameterCollection
ReadParameter protected
Reads parameter's value from the provided IMessage instance.
method ReadParameter(message: IMessage; parameter: DynamicRequestParameter)
void ReadParameter(IMessage message, DynamicRequestParameter parameter)
Sub ReadParameter(message As IMessage, parameter As DynamicRequestParameter)
Parameters:
- message: Message used to communicate with the server
- parameter: Method call parameter
RemoteService
Gets or sets the RemoteService class instance that defines the remote service to call.
property RemoteService: RemoteService read write;
RemoteService RemoteService { get; set; }
Property RemoteService() As RemoteService
ResultParameter
Gets the parameter containing result of the remote method call.
property ResultParameter: DynamicRequestParameter read;
DynamicRequestParameter ResultParameter { get; }
ReadOnly Property ResultParameter() As DynamicRequestParameter
UpdateParamsFromRodl
Retrieves the RODL from the server, locates the service and method and populates the Parameters collection with the appropriate parameter definitions required for the remote method call. Any parameters or values defined prior to calling this method will be removed.
method UpdateParamsFromRodl
void UpdateParamsFromRodl()
Sub UpdateParamsFromRodl()
UpdateParamsFromRodlOperation
Populates the Parameters collection with the appropriate parameter definitions required for the remote method call. Any parameters or values defined prior to calling this method will be removed.
Unlike the UpdateParamsFromRodl method this method doesn't try to obtain the RODL from the server. Instead it takes the needed information from the provided RodlOperation instance.
method UpdateParamsFromRodlOperation(operation: RodlOperation)
void UpdateParamsFromRodlOperation(RodlOperation operation)
Sub UpdateParamsFromRodlOperation(operation As RodlOperation)
Parameters:
- operation: Server method definition
Validate protected
Validates property values of the current DynamicRequest instance. This method is called when the remote method call is sent to the server.
This method validates the RemoteService.RemoteService settings and ensures that the RemoteService.MethodName property is set.
method Validate
void Validate()
Sub Validate()
WriteParameter protected
Writes parameter name, type and value to the provided IMessage instance.
method WriteParameter(message: IMessage; parameter: DynamicRequestParameter)
void WriteParameter(IMessage message, DynamicRequestParameter parameter)
Sub WriteParameter(message As IMessage, parameter As DynamicRequestParameter)
Parameters:
- message: Message used to communicate with the server
- parameter: Remote method call parameter
MethodName
Gets or sets the the name of the remote service method to call.
Note: If the RemoteService property is assigned and the server is available at design time, you can select the method name from a list of available methods in the Property Browser's drop down box. When doing this, the Parameters collection will automatically be populated as well.
property MethodName: String read write;
String MethodName { get; set; }
Property MethodName() As String
Parameters
Gets collection of the parameters that will be passed into and out of the method call.
For the method call call to succeed these parameters have to exactly match the parameters defined for the service method on the server side.
The UpdateParamsFromRodl and UpdateParamsFromRodlOperation methods can be used to populate the parameters automatically. Once the parameters are defined they an be accessed using the ParameterByName method.
Note: If the RemoteService property is assigned and the server is available at design time, you can select the method name from a list of available methods in the Property Browser's drop down box. When doing this, the Parameters collection will automatically be populated as well.
property Parameters: DynamicRequestParameterCollection read;
DynamicRequestParameterCollection Parameters { get; }
ReadOnly Property Parameters() As DynamicRequestParameterCollection
RemoteService
Gets or sets the RemoteService class instance that defines the remote service to call.
property RemoteService: RemoteService read write;
RemoteService RemoteService { get; set; }
Property RemoteService() As RemoteService
ResultParameter
Gets the parameter containing result of the remote method call.
property ResultParameter: DynamicRequestParameter read;
DynamicRequestParameter ResultParameter { get; }
ReadOnly Property ResultParameter() As DynamicRequestParameter
constructor
Creates a new instance of the DynamicRequest class.
constructor
DynamicRequest()
Sub New()
constructor (IContainer)
Creates a new instance of the DynamicRequest class and adds it to the providec components collection.
constructor(container: IContainer)
DynamicRequest(IContainer container)
Sub New(container As IContainer)
Parameters:
- container: Components collection
constructor (String, RemoteService)
Creates a new instance of the DynamicRequest class and sets its MethodName and RemoteService properties.
constructor(methodName: String; remoteService: RemoteService)
DynamicRequest(String methodName, RemoteService remoteService)
Sub New(methodName As String, remoteService As RemoteService)
Parameters:
- methodName: Remote method name
- remoteService: RemoteService class instance identifying the remote service
constructor (String, RemoteService, array of DynamicRequestParameter)
Creates a new instance of the DynamicRequest class and sets its MethodName, RemoteService and Parameters properties.
constructor(methodName: String; remoteService: RemoteService; parameters: array of DynamicRequestParameter)
DynamicRequest(String methodName, RemoteService remoteService, DynamicRequestParameter[] parameters)
Sub New(methodName As String, remoteService As RemoteService, parameters As DynamicRequestParameter())
Parameters:
- methodName: Remote method name
- remoteService: RemoteService class instance identifying the remote service
- parameters: Parameters of the remote method call
constructor (String, RemoteService, DynamicRequestParameterCollection)
Creates a new instance of the DynamicRequest class and sets its MethodName, RemoteService and Parameters properties.
constructor(methodName: String; remoteService: RemoteService; parameters: DynamicRequestParameterCollection)
DynamicRequest(String methodName, RemoteService remoteService, DynamicRequestParameterCollection parameters)
Sub New(methodName As String, remoteService As RemoteService, parameters As DynamicRequestParameterCollection)
Parameters:
- methodName: Remote method name
- remoteService: RemoteService class instance identifying the remote service
- parameters: Parameters of the remote method call
constructor (String, RemoteService, IList<DynamicRequestParameter>)
Creates a new instance of the DynamicRequest class and sets its MethodName, RemoteService and Parameters properties.
constructor(methodName: String; remoteService: RemoteService; parameters: IList<DynamicRequestParameter>)
DynamicRequest(String methodName, RemoteService remoteService, IList<DynamicRequestParameter> parameters)
Sub New(methodName As String, remoteService As RemoteService, parameters As IList<DynamicRequestParameter>)
Parameters:
- methodName: Remote method name
- remoteService: RemoteService class instance identifying the remote service
- parameters: Parameters of the remote method call
BeginMakeRequest
Asynchronously starts request to the remote service.
method BeginMakeRequest(cb: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginMakeRequest(AsyncCallback cb, Object state)
Function BeginMakeRequest(cb As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- cb: Callback method that will be called once the asynchronous operation is completed
- state: Asynchronous operation state object
EndMakeRequest
Finishes the asynchronous request to the remote service.
method EndMakeRequest(ar: IAsyncResult)
void EndMakeRequest(IAsyncResult ar)
Sub EndMakeRequest(ar As IAsyncResult)
Parameters:
- ar: Object representing the status of an asynchronous operation
MakeRequest
Performs the actual request to the remote service.
method MakeRequest
void MakeRequest()
Sub MakeRequest()
ParameterByName
Returns the DynamicRequestParameter with the given name.
This method can be used to populate all parameters with their values without relying on their ordering.
method ParameterByName(parameterName: String): DynamicRequestParameter
DynamicRequestParameter ParameterByName(String parameterName)
Function ParameterByName(parameterName As String) As DynamicRequestParameter
Parameters:
- parameterName: Parameter name
ReadParameter protected
Reads parameter's value from the provided IMessage instance.
method ReadParameter(message: IMessage; parameter: DynamicRequestParameter)
void ReadParameter(IMessage message, DynamicRequestParameter parameter)
Sub ReadParameter(message As IMessage, parameter As DynamicRequestParameter)
Parameters:
- message: Message used to communicate with the server
- parameter: Method call parameter
UpdateParamsFromRodl
Retrieves the RODL from the server, locates the service and method and populates the Parameters collection with the appropriate parameter definitions required for the remote method call. Any parameters or values defined prior to calling this method will be removed.
method UpdateParamsFromRodl
void UpdateParamsFromRodl()
Sub UpdateParamsFromRodl()
UpdateParamsFromRodlOperation
Populates the Parameters collection with the appropriate parameter definitions required for the remote method call. Any parameters or values defined prior to calling this method will be removed.
Unlike the UpdateParamsFromRodl method this method doesn't try to obtain the RODL from the server. Instead it takes the needed information from the provided RodlOperation instance.
method UpdateParamsFromRodlOperation(operation: RodlOperation)
void UpdateParamsFromRodlOperation(RodlOperation operation)
Sub UpdateParamsFromRodlOperation(operation As RodlOperation)
Parameters:
- operation: Server method definition
Validate protected
Validates property values of the current DynamicRequest instance. This method is called when the remote method call is sent to the server.
This method validates the RemoteService.RemoteService settings and ensures that the RemoteService.MethodName property is set.
method Validate
void Validate()
Sub Validate()
WriteParameter protected
Writes parameter name, type and value to the provided IMessage instance.
method WriteParameter(message: IMessage; parameter: DynamicRequestParameter)
void WriteParameter(IMessage message, DynamicRequestParameter parameter)
Sub WriteParameter(message As IMessage, parameter As DynamicRequestParameter)
Parameters:
- message: Message used to communicate with the server
- parameter: Remote method call parameter