This is Client Protocol WAMP Component, you need to drop this component in the form and select a TsgcWebSocketClient Component using Client Property.
ABORT: Both the Router and the Client may abort the opening of a WAMP session by sending an ABORT message.
Reason MUST be an URI.
Details MUST be a dictionary that allows to provide additional, optional closing information (see below).
No response to an ABORT message is expected.
GOODBYE: A WAMP session starts its lifetime with the Router sending a WELCOME message to the Client and ends when the underlying transport disappears or when the WAMP session is closed explicitly by a GOODBYE message sent by one Peer and a GOODBYE message sent from the other Peer in response.
Reason MUST be a URI.
Details MUST be a dictionary that allows providing additional, optional closing information.
PUBLISH: When a Publisher requests to publish an event to some topic, it sends a PUBLISH message to a Broker:
Request is a random, ephemeral ID chosen by the Publisher and used to correlate the Broker's response with the request.
Options is a dictionary that allows to provide additional publication request details in an extensible way. This is described further below.
Topic is the topic published to.
Arguments is a list of application-level event payload elements. The list may be of zero length.
ArgumentsKw is an optional dictionary containing application-level event payload, provided as keyword arguments. The dictionary may be empty.
If the Broker is able to fulfil and allowing the publication, the Broker will send the event to all current Subscribers of the topic of the published event.
By default, publications are unacknowledged, and the Broker will not respond, whether the publication was successful indeed or not.
SUBSCRIBE: A Subscriber communicates its interest in a topic to a Broker by sending a SUBSCRIBE message:
Request MUST be a random, ephemeral ID chosen by the Subscriber and used to correlate the Broker's response with the request.
Options MUST be a dictionary that allows providing additional subscription request details in an extensible way.
Topic is the topic the Subscriber wants to subscribe to and MUST be a URI.
UNSUBSCRIBE: When a Subscriber is no longer interested in receiving events for a subscription it sends an UNSUBSCRIBE message
Request MUST be a random, ephemeral ID chosen by the Subscriber and used to correlate the Broker's response with the request.
SUBSCRIBED.Subscription MUST be the ID for the subscription to unsubscribe from, originally handed out by the Broker to the Subscriber.
CALL: When a Caller wishes to call a remote procedure, it sends a CALL message to a Dealer:
Request is a random, ephemeral ID chosen by the Caller and used to correlate the Dealer's response with the request.
Options is a dictionary that allows to provide additional call request details in an extensible way. This is described further below.
Procedure is the URI of the procedure to be called.
Arguments is a list of positional call arguments (each of arbitrary type). The list may be of zero length.
ArgumentsKw is a dictionary of keyword call arguments (each of arbitrary type). The dictionary may be empty.
REGISTERCALL: A Callee announces the availability of an endpoint implementing a procedure with a Dealer by sending a REGISTER message:
Request is a random, ephemeral ID chosen by the Callee and used to correlate the Dealer's response with the request.
Options is a dictionary that allows providing additional registration request details in a extensible way. This is described further below.
Procedure is the procedure the Callee wants to register
UNREGISTERCALL: When a Callee is no longer willing to provide an implementation of the registered procedure, it sends an UNREGISTER message to the Dealer:
Request is a random, ephemeral ID chosen by the Callee and used to correlate the Dealer's response with the request.
REGISTERED.Registration is the ID for the registration to revoke, originally handed out by the Dealer to the Callee.
INVOCATION: If the Dealer is able to fulfil (mediate) the call and it allows the call, it sends a INVOCATION message to the respective Callee implementing the procedure:
Request is a random, ephemeral ID chosen by the Dealer and used to correlate the Callee's response with the request.
REGISTERED.Registration is the registration ID under which the procedure was registered at the Dealer.
Details is a dictionary that allows to provide additional invocation request details in an extensible way. This is described further below.
CALL.Arguments is the original list of positional call arguments as provided by the Caller.
CALL.ArgumentsKw is the original dictionary of keyword call arguments as provided by the Caller.
YIELD: If the Callee is able to successfully process and finish the execution of the call, it answers by sending a YIELD message to the Dealer:
INVOCATION.Request is the ID from the original invocation request.
Options is a dictionary that allows providing additional options.
Arguments is a list of positional result elements (each of arbitrary type). The list may be of zero length.
ArgumentsKw is a dictionary of keyword result elements (each of arbitrary type). The dictionary may be empty.
OnWAMPSession: After the underlying transport has been established, the opening of a WAMP session is initiated by the Client sending a HELLO message to the Router
OnWAMPWelcome: A Router completes the opening of a WAMP session by sending a WELCOME reply message to the Client.
OnWAMPChallenge: this event is raised when server requires client authenticate against server.
Example: Authentication using ticket method.
// First OnWAMPSession event will be called asking details about new session, set realm and authentication id
// which will be sent to serve
procedure OnWAMPSession(Connection: TsgcWSConnection;
var aRealm, aDetails: string);
begin
aRealm := 'realm1';
aDetails := '{"authmethods": ["ticket"], "authid": "joe"}';
end;
// If AuthId parameter is accepted by server, it will request an authentication through Challenge message,
// here you can set "secret key" of "authid" param.
procedure OnWAMPChallenge(Connection:
TsgcWSConnection; AuthMethod, Details: string; var Secret: string);
begin
Secret := 'your secret key';
end;
// If Authentication is successful, server will send a Welcome message
procedure OnWAMPWelcome(Connection: TsgcWSConnection;
SessionId: Int64; Details: string);
begin
ShowMessage('authenticated');
end;
OnWAMPAbort: Both the Router and the Client may abort the opening of a WAMP session by sending an ABORT message.
OnWAMPGoodBye: A WAMP session starts its lifetime with the Router sending a WELCOME message to the Client and ends when the underlying transport disappears or when the WAMP session is closed explicitly by a GOODBYE message sent by one Peer and a GOODBYE message sent from the other Peer in response.
OnWAMPSubscribed: If the Broker is able to fulfill and allow the subscription, it answers by sending a SUBSCRIBED message to the Subscriber
SUBSCRIBE.Request: MUST be the ID from the original request.
Subscription: MUST be an ID chosen by the Broker for the subscription.
OnWAMPUnSubscribed: Upon successful unsubscription, the Broker sends an UNSUBSCRIBED message to the Subscriber
UNSUBSCRIBE.Request: MUST be the ID from the original request.
OnWAMPPublished: If the Broker is able to fulfill and allowing the publication, and PUBLISH.Options.acknowledge == true, the Broker replies by sending a PUBLISHED message to the Publisher:
PUBLISH.Request: is the ID from the original publication request.
Publication: is a ID chosen by the Broker for the publication.
OnWAMPEvent: When a publication is successful and a Broker dispatches the event, it determines a list of receivers for the event based on Subscribers for the topic published to and, possibly, other information in the event. Note that the Publisher of an event will never receive the published event even if the Publisher is also a Subscriber of the topic published to. The Advanced Profile provides options for more detailed control over publication. When a Subscriber is deemed to be a receiver, the Broker sends the Subscriber an EVENT message.
SUBSCRIBED.Subscription: is the ID for the subscription under which the Subscriber receives the event - the ID for the subscription originally handed out by the Broker to the Subscribe*.
PUBLISHED.Publication: is the ID of the publication of the published event.
DETAILS: is a dictionary that allows the Broker to provide additional event details in a extensible way.
PUBLISH.Arguments: is the application-level event payload that was provided with the original publication request.
PUBLISH.ArgumentKw: is the application-level event payload that was provided with the original publication request.
OnWAMPError: When the request fails, the Broker sends an ERROR
METHOD: is the ID of the Method.
REQUEST.ID: is the ID of the Request.
DETAILS: is a dictionary that allows the Broker to provide additional event details in a extensible way.
ERROR: describes the message error.
PUBLISH.Arguments: is the application-level event payload that was provided with the original publication request.
PUBLISH.ArgumentKw: is the application-level event payload that was provided with the original publication request.
OnWAMPResult: The Dealer will then send a RESULT message to the original Caller:
CALL.Request: is the ID from the original call request.
DETAILS: is a dictionary of additional details.
YIELD.Arguments: is the original list of positional result elements as returned by the Callee.
YIELD.ArgumentsKw: is the original dictionary of keyword result elements as returned by the Callee.
OnWAMPRegistered: If the Dealer is able to fulfill and allowing the registration, it answers by sending a REGISTERED message to the Callee:
REGISTER.Request: is the ID from the original request.
Registration: is an ID chosen by the Dealer for the registration.
OnWAMPUnRegistered: When a Callee is no longer willing to provide an implementation of the registered procedure, it sends an UNREGISTER message to the Dealer:
Request: is a random, ephemeral ID chosen by the Callee and used to correlate the Dealer's response with the request.
REGISTERED.Registration: is the ID for the registration to revoke, originally handed out by the Dealer to the Callee.