I need to call an OPC UA method with a struct as an InputArgument. In this case, the struct is a AnonymousIdentityToken. I tried to create an ExtensionObject containing the tokenValue, but this was not successful when the method was called.
token := ua.AnonymousIdentityToken{PolicyId: "anonymous"}
myVariant := ua.MustVariant(???)
req := &ua.CallMethodRequest{
ObjectID: ua.NewStringNodeID(2, "main"),
MethodID: ua.NewStringNodeID(2, "even"),
InputArguments: []*ua.Variant{
myVariant,
... more inputArguments...
},
}
So how can a structured value be passed into a Variant?