SignalRService

The Linx SignalRService incorporates the required functionality to allow for:

  • SignalR and/or REST requests to your service
  • JWT Authentication of those requests
  • the handling of the operations that are to be executed when a request is received
Quick Steps
  1. Add SignalR plugin to your solution.
  2. Drag SignalRService onto the Solution Explorer panel.
  3. Set properties for the service. (See below for details.)
  4. Click Edit button (Operations property).
  5. Add Server method (e.g. SendMessage) and Client method (e.g. ReceiveMessage) in the Operations Editor.
  6. Drag required functions and types onto the design canvas of an event that was created for your service when you added the Server method (e.g. SendMessage) in the previous step.
  7. Click Debug (on top toolbar) to test and debug your solution, or right-click on the service or service event (in the Solution Explorer), then select Debug to specifically test and debug the service.

Properties

Hub URL

SignalR hub URL, e.g. http://localhost/chatHub.

REST requests will be allowed on {baseURL}/api, e.g. http://localhost/api.

To prevent REST requests on this address, specify a REST URL.

What is a hub? SignalR uses hubs to communicate between clients and servers. Find out more here.

REST URL

Optional base URL to use for REST requests, e.g. http://localhost:8080.

REST endpoints will be accessible on {baseURL}/api, e.g. http://localhost:8080/api.

If not specified, REST requests will be allowed on the hub URL.

Security

The type of security used for authentication.

Select either None or JWT Authentication.

When selecting JWT Authentication, provide the following:

Secret key

Secret key used to validate the JWT token.

Claims

Comma-separated list of claim names to resolve on the event input, e.g. "name,exp".

Operations

SignalR operation metadata.

Click the Edit button to open the SignalR Operations Editor.

SignalR operations


For each Operation that you add, provide the details for both the Server method and for the Client method.

Server method

Specify a name for the method that is executed as an event when the operation is performed.

Client method

Specify the name of the client method.

Execution type

Indicate whether the operation can be accessed via the Hub (SignalR), REST, or both.

  • Select Hub if you only want to use the Hub URL to make calls on.
  • If you select REST, but don't specify a REST URL, then the REST calls will be made on the Hub URL. If you select REST and you provide a REST URL, then REST calls will always be made on the REST URL.
  • If you select Both, then calls can be made on both Hub and REST URL's. If no REST URL is provided, then REST calls will be made on the Hub URL.

Parameters

Add the parameters that are required by each operation.

For each Operation an Event is created. Add relevant functions to an Event to execute the Operation.

Sample

Go here for a Linx sample solution that uses SignalR to build a basic web chat application.

Introduction to SignalR