TsgcWSPClient_WAMP2

This is Client Protocol WAMP Component, you need to drop this component in the form and select a TsgcWebSocketClient Component using Client Property.

 

Session Methods

 

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.

 

 

Reason MUST be a URI.

Details MUST be a dictionary that allows providing additional, optional closing information.

 

Publish/Subscribe Methods

 

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.

 

 

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.

 

 

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.

 

RPC Methods

 

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.

 

 

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

 

 

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.

 

 

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.

 

 

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.

 

 

Events

 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

 

 

 

OnWAMPUnSubscribed: Upon successful unsubscription, the Broker sends an UNSUBSCRIBED message to the Subscriber

 

 

 

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:

 

 

 

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.

 

 

 

OnWAMPError: When the request fails, the Broker sends an ERROR

 

 

 

OnWAMPResult: The Dealer will then send a RESULT message to the original Caller:

 

 

 

OnWAMPRegistered: If the Dealer is able to fulfill and allowing the registration, it answers by sending a REGISTERED message to the Callee:

 

 

 

OnWAMPUnRegistered: When a Callee is no longer willing to provide an implementation of the registered procedure, it sends an UNREGISTER message to the Dealer: