milo icon indicating copy to clipboard operation
milo copied to clipboard

Call milo opc-ua server ConditionType_ConditionRefresh method failed.

Open cityWalker312 opened this issue 3 years ago • 2 comments

Describe the bug Use milo client call milo opc-ua server ConditionType_ConditionRefresh failed. We try to call the method from UaExpert app failed too on milo opc-ua server.

Use milo client call open62541 opc-ua server ConditionType_ConditionRefresh successfully.

Here is the call method codeblock.

private boolean callConditionRefresh(OpcUaClient client, CompletableFuture<OpcUaClient> future, int subId) {
        NodeId objectId = Identifiers.ConditionType;
        NodeId methodId = Identifiers.ConditionType_ConditionRefresh;
        CallMethodRequest request = new CallMethodRequest(
                objectId,
                methodId,
                new Variant[]{new Variant(UInteger.valueOf(subId))}
        );
        client.call(request).thenCompose(result -> {
            StatusCode statusCode = result.getStatusCode();
            if (statusCode.isGood()) {
                return CompletableFuture.completedFuture(0);
            } else {
                StatusCode[] inputArgumentResults = result.getInputArgumentResults();
                if (inputArgumentResults != null) {
                    for (int i = 0; i < inputArgumentResults.length; i++) {
                        logger.error("inputArgumentResults[{}]={}", i, inputArgumentResults[i]);
                    }
                }
                CompletableFuture<Integer> f = new CompletableFuture<>();
                f.completeExceptionally(new UaException(statusCode));
                return f;
            }
        });

        return true;
    }

Expected behavior Call the ConditionType_ConditionRefresh method successfull.

Logs and Packet Captures If applicable, add application logs or Wireshark captures to help explain your problem. image

Additional context The milo version is 0.6.3.

cityWalker312 avatar Oct 27 '22 09:10 cityWalker312

Thanks for the report, this does look like a bug in the Milo server.

Note to future self: the issue is "known" and will be fixed when this TODO is resolved: https://github.com/eclipse/milo/blob/3419235853491ac89f3391bffd337c8200522522/opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/api/methods/AbstractMethodInvocationHandler.java#L79-L83

kevinherron avatar Oct 28 '22 14:10 kevinherron

Thanks for the report, this does look like a bug in the Milo server.

Note to future self: the issue is "known" and will be fixed when this TODO is resolved:

https://github.com/eclipse/milo/blob/3419235853491ac89f3391bffd337c8200522522/opc-ua-sdk/sdk-server/src/main/java/org/eclipse/milo/opcua/sdk/server/api/methods/AbstractMethodInvocationHandler.java#L79-L83

Thanks for your reply. Does milo have a plan to fix this issue ? Our project need to use this feature.

cityWalker312 avatar Oct 29 '22 03:10 cityWalker312

WIP branch with a test that reproduces: https://github.com/eclipse/milo/tree/issues/gh1073

kevinherron avatar Mar 16 '24 21:03 kevinherron

Fixed in https://github.com/eclipse/milo/commit/73e9fef7b933198471ad25e747c845044d3d5880 for 1.0 release.

kevinherron avatar Mar 17 '24 14:03 kevinherron