Subscribe

A page that uses JSON, JavaScript and WebSockets to subscribe to data in an OPC UA server.

This page uses JavaScript to construct JSON messages needed to create a session and a subscription with an OPC UA ReferenceServer. The parameters in the CreateSession, ActivateSession and CreateSubscription requests and responses are defined in Part 4.

Note that the OPC UA WebSockets mapping allows user authentication in the CreateSession request so it is not necessary to pass the authentication in the HTTP request headers. That said, some servers may require it.

The following figure illustrates the interactions between the website and the OPC UA ReferenceServer:

Subscribe Sequence Diagram

The syntax used to specify NodeIds is defined in Part 6.


Server
Node ID
Value
Timestamp
Sequence Number