Websocket Client Activity

You can use the Websocket Client activity to create connection and send messages to the Websocket server.

Settings

Field Required Description
URI Yes

URI of the Websocket server. The URI must be in the following format: wss:// for secure connections or ws:// for insecure connections.

This field can also be set by using an application property.

Tip: To dynamically override the path provided in the URI, you can enter the URI as:

ws://<host-url>:port/{path}

Here, {path} is the parameter that can be modified. You can map this parameter in the Input section and assign values to it from the previous activities or the application properties.

Allow Insecure Connection Yes The Allow Insecure Connection field is available if wss:// is present in the URI field. Set this field to True to use the self-signed development mode certificates for connecting to the server.
Server CA Yes Selects the certificate authority file used to sign the server's certificate for secure connections. This field is available if the Allow Insecure Connection field is set to False.
Message format Yes

Selects one of the following formats of the message body:

String: String message.

JSON: If JSON is selected, a text editor is provided to accept a JSON document.

Schema for JSON value No The JSON schema for the Websocket message. The Schema for JSON value field is only available when the Message Format field is JSON. This is a free form text editor that accepts any valid JSON document. You can also specify an app-level schema by using the Use app level schema option.

Input Settings

The Input Settings tab has the following fields:

Field Required Description
Path Params No Path parameters that are appended to the path.
Query Params No

Query parameters to be appended to the path. To add the query parameters, click the Add row button and press Enter to save your changes.

parameterName: Name of the query parameter

type: The data type of the query parameter. Supported types are string, number, or boolean.

repeating: Set to True if more than one value is expected for the query parameter.

required: Set to True if query parameter is a required configuration. The trigger reports an error if no values are provided to the required query parameter.

Note: You must add Query parameters by using the Query Params field on the Input Settings tab only. Appending query parameters directly in the URI field is not recommended.
Request Headers No

HTTP request Header parameters. To add the header parameters, click the Add row button and press Enter to save your changes.

parameterName: Name of the header parameter.

type: The data type of the header parameter. Supported types are string, number, or boolean.

repeating: Set to True if more than one value is expected for the HTTP header.

required: Set to True if header parameter is a required configuration. The trigger reports an error if no values are provided to the required header parameter.

Input

The Input tab displays the elements of the schema that you entered on the Settings tab in a tree format. You can enter the values for each element by hard coding the value or mapping the value to an element from the output schema of a previous activity in the flow.

Loop

To iterate Websocket Client activity multiple times within the flow, enter an expression that evaluates to the iteration details. Select a type of iteration from the Type menu. The default type is None, which means the activity does not iterate. For more information about Loop, see the "Using the Loop Feature in an Activity" topic in the TIBCO Flogo® Enterprise documentation.