我试图从客户端向服务器添加节点,如下所示:
AddNodesItem newItem = new AddNodesItem(
new NodeId(2,"Vehicles").expanded(),
Identifiers.Organizes,
new NodeId(2,"Vehicles/vehicle2").expanded(),
new QualifiedName(2,"Vehicles/vehicle2"),
NodeClass.Object,
null,
new NodeId(2,"Object/Types/Vehicle").expanded());
List<AddNodesItem> items = new ArrayList<AddNodesItem>();
items.add(newItem);
client.addNodes(items).get();
future.complete(client);
但我只得到了错误:
[main] ERROR Client1.Client - Error running client example: UaServiceFaultException: status=Bad_ServiceUnsupported, message=The server does not support the requested service.
java.util.concurrent.ExecutionException: UaServiceFaultException: status=Bad_ServiceUnsupported, message=The server does not support the requested service.
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at Client1.AddNode.run(AddNode.java:37)
at Client1.Client.run(Client.java:103)
at Client1.AddNode.main(AddNode.java:18)
我搜索了一下,也许我应该先做服务器配置,但是怎么做呢?任何指南或答案都会有所帮助,非常感谢!