

16:52, EEST

June 20, 2025

Hi,
I have a question regarding the use of the Prosys OPC UA Simulation Server for testing method calls.
I created a method inside the Simulation folder. This method is designed not to have any input arguments, since I don’t want the function to accept any. As an output argument, I’ve defined a scalar String, similar to an example I found on the OPC UA website. For the SET action, I configured it to assign a constant value from the simulation folder to a specific variable (just for simple testing).
On the client side, my code for calling the method looks like this:
UA_Variant *output;
size_t outputSize;
UA_StatusCode retval = UA_Client_call(client,
UA_NODEID_STRING(3, “85/0:Simulation”), // Parent object
UA_NODEID_NUMERIC(3, 1011), // Method NodeId
0, NULL, // No input arguments
&outputSize,
&output);
if(retval == UA_STATUSCODE_GOOD) {
printf(“Method call succeeded. Output count: %lu
“, (unsigned long)outputSize);
// Handle output
UA_Array_delete(output, outputSize, &UA_TYPES[UA_TYPES_VARIANT]);
} else {
printf(“Method call failed. StatusCode: 0x%08x
“, retval);
}
However, this call fails with status code: 0x80020000 (BadInternalError).
Interestingly, when I define another method that does have one input argument (e.g., a Double), it works perfectly fine using the same approach.
The only difference between the two methods is that this one doesn’t take any input arguments.
Could someone help me understand what I might be missing in the configuration of the method with no inputs?
Do I still need to define an empty InputArguments property explicitly for methods without inputs?
Thanks in advance!
16:36, EEST

April 3, 2012

Hi,
Sorry for a late answer. Can you try the Method call with https://prosysopc.com/products…..a-browser/ (r-click the method node in the address space tree)? I could not reproduce the problem (using Browser). Can you verify via https://prosysopc.com/blog/opc…..wireshark/ (or the Req/Res Log tab in Simulation Server) that the Method Call request actually arrived in the server? Sometimes the statuscodes are also used to indicate client-side issues.
1 Guest(s)
