TsgcWSPClient_WAMPMethods › Call

Call Method

Invokes a remote procedure identified by its URI and correlates the eventual result or error to the supplied call id.

Syntax

procedure Call(const aCallId, aProcURI: String; aArguments: String = '');

Parameters

NameTypeDescription
aCallIdconst StringCaller-generated unique identifier echoed back in OnCallResult, OnCallProgressResult or OnCallError; typically a GUID so that concurrent calls can be routed to their continuations.
aProcURIconst StringFully-qualified URI of the remote procedure, or a shortcut of the form prefix:name resolved through a prior Prefix registration.
aArgumentsStringOptional JSON payload with the call arguments. Pass a JSON array for positional arguments or a JSON object for named arguments; leave empty when the procedure takes none.

Remarks

Sends a WAMP v1 CALL message (type id 2) over the active transport. The call is asynchronous: the method returns as soon as the frame is queued and the outcome is delivered later through one of the RPC events. The server may stream interim results via OnCallProgressResult before firing the final OnCallResult or OnCallError. To abort an in-flight call, invoke CancelCall with the same aCallId.

Example


var
  vCallId: string;
begin
  vCallId := TGuid.NewGuid.ToString;
  WAMP.Call(vCallId, 'http://example.com/simple#add', '[23, 19]');
end;

Back to Methods