0

我试图从客户端向服务器添加节点,如下所示:

        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)

我搜索了一下,也许我应该先做服务器配置,但是怎么做呢?任何指南或答案都会有所帮助,非常感谢!

4

1 回答 1

0

您的客户端代码看起来不错,但这仅适用于已实现并支持节点管理服务的服务器。

Milo 示例服务器没有实现这些服务,因此您必须找到不同的服务器进行测试。

于 2019-12-11T16:35:19.617 回答