TsgcWSPClient_WAMP › Methods › Prefix
Registers a short label that expands to a full URI, letting later Call, Subscribe and Publish frames use a compact notation.
procedure Prefix(const aPrefix, aURI: String);
| Name | Type | Description |
|---|---|---|
aPrefix | const String | Short label used in subsequent CURIEs (for example calc). The label is local to this WAMP session only. |
aURI | const String | Fully-qualified URI the prefix expands to (for example http://example.com/simple/calc#). Usually ends with # or / so the suffix concatenates cleanly. |
Sends a WAMP v1 PREFIX frame (type id 1). Conceptually similar to an XML-namespace alias: once registered, any Call, Subscribe, UnSubscribe or Publish can reference prefix:name instead of the full URI, which shortens payloads on busy sessions. Prefixes persist only for the lifetime of the current session; re-register them after reconnect. The server maintains the mapping per-client, so different clients can use the same short label for different URIs.
WAMP.Prefix('calc', 'http://example.com/simple/calc#');
// subsequent calls may use the shortcut
WAMP.Call(vCallId, 'calc:add', '[23, 19]');