TsgcWSPClient_sgc › Methods › RPC
Sends a remote procedure call request and awaits a Result or Error response.
procedure RPC(const aId, aMethod: string; const aParams: string = ''; const aGuid: String = ''; const aQueue: TwsQueue = queueLevel0);
| Name | Type | Description |
|---|---|---|
aId | const string | Unique call identifier used to correlate the response. Leave empty to let the component generate a new Guid. |
aMethod | const string | Name of the remote method to invoke on the server. |
aParams | const string | Optional parameter payload (typically a JSON string). |
aGuid | const String | Optional Guid of the target server-side sgc protocol instance. Leave empty to use the default. |
aQueue | const TwsQueue | Queue level used when the server applies transactional queuing to the call. |
The call is tracked locally in the RPC list; when the server responds, either OnRPCResult or OnRPCError fires with the matching Id and the entry is removed. Use GetRPCMethodById or GetRPCParamsById inside those handlers to retrieve the original request.
oProtocol.RPC('', 'getUsers', '{"page":1}');