
05/30/2017

The OPC Foundation has created a simple website to demonstrate how to use JSON, JavaScript and REST like APIs to communicate with the .NETStandard ReferenceServer (see https://github.com/OPCFoundati.....emo/webapi).
The site can be found here: https://prototyping.opcfoundation.org
This documentation for the JSON encoding is here: https://reference.opcfoundatio.....Part6/#5.4
The documentation for the the HTTPS binding is here: https://reference.opcfoundatio.....Part6/#7.4
The documentation for the WebSockets binding is here: https://reference.opcfoundatio.....Part6/#7.5
The documentation for the Sessionless Service calls used to implement the WebAPI is here: https://reference.opcfoundatio.....Part4/#6.3
This thread is for questions and discussions.
If someone has done their own OPC UA JSON/JavaScript implementation and they want to tell people about them please leave a link in this thread.

07/29/2019

Hello
I just tried the demosite prototyping.opcfoundation.org, and when using the Subscribe demo, its unable to connect to the OPC-UA Server at address prototyping.opcfoundation.org:62542. I remember the trainer from the demo said he had to open the port temporarly.
So am I right with the assumption that this sample will not work anymore at all or is it just a network / server issue and the server should be reachable again?
I want to build my own node.js / React / Typescript sample here in my office and need a server to get the data from.
Greetings and thanks for the nice example.
Alex

05/30/2017

The server is still running, however, I cannot access from FireFox on some machines.
Edge seems to work.
You should also be able to use the .NET client to connect using websockets in:
https://github.com/OPCFoundati...../Reference

04/13/2020

Since the presentation the websocket example uses the non-reversible form (the example before used the reversible form).
Could you change it back to the reversible form?
NotificationData provides an array of ExtensionObjects and in the reversible form the type id of this ExtensionObject has to be present
This is not the case in the example:
{
"TypeId": {
"Id": 827
},
"Body": {
"ResponseHeader": {
"Timestamp": "2020-04-14T06:15:08.4207221Z",
"RequestHandle": 6,
"StringTable": []
},
"SubscriptionId": 15,
"AvailableSequenceNumbers": [
2
],
"MoreNotifications": false,
"NotificationMessage": {
"SequenceNumber": 2,
"PublishTime": "2020-04-14T06:15:08.4207221Z",
"NotificationData": [
{
"!!!!!!!!!!! TypeId IS MISSING !!!!!!!!!!!!!!!!!"
"Body": {
"MonitoredItems": [
{
"ClientHandle": 1,
"Value": {
"Value": {
"Type": 11,
"Body": 1.789481742797868e+35
},
"SourceTimestamp": "2020-04-14T06:15:07.5858651Z"
}
}
],
"DiagnosticInfos": []
}
}
]
},
"Results": [
0
],
"DiagnosticInfos": []
}
}

05/30/2017

The UA subscription model includes flow control so updates are only sent after the client indicates it is ready to receive them.
Clients ready to received will send multiple Publish requests that are held on the server until changes to the data are detected.
When using a full-duplex channel like websockets the client can send the publish requests and then use the same channel for other services.
IOW, it make look like polling in a simple application but architecturally it is not.

05/30/2017

In theory, the JavaScript communicates directly with the UA server.
In practice, cross-sight scripting rules (CORS) mean scripts can only communicate with the site that served the scripts.
CORS could be addressed in a number of ways:
- Have the UA server act as a HTTP server that provides the HTML/scripts
- Use HTTP rewrite rules on the server that redirect JSON requests to the UA server (AKA reverse proxy);
- Have a web method forward the JSON to the UA server;
The example uses 3), however, this is least elegant solution.
2) is probably the best for real solution.
1 Guest(s)