Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[milo-dev] how to decode "Structures with optional fields"

Hi all,
I need to know which one is the right option to decode a structure with optional field?

https://reference.opcfoundation.org/Core/Part6/v105/docs/5.2.7

Reading the page, it seems that I have to use the function 
ByteString JoiningProcessId = decoder.readByteString("JoiningProcessId");

but if I try to use it I get 

imput v0:ddd
imput v1:ExtensionObject{encoded=ByteString{bytes=[7, 0, 0, 0, 2, 0, 0, 0, 51, 52, 2, 0, 0, 0, 50, 50, 2, 0, 0, 0, 50, 50]}, encodingId=NodeId{ns=6, id=5121}}
imput v2:LocalizedText{text=yyyy, locale=it}
decode JoiningProcessIdentificationDataType

JoiningProcessId ByteString{bytes=[2, 0, 0, 0, 51, 52, 2]}
12:43:02.438 [milo-shared-thread-pool-6] ERROR o.e.m.e.m.opcua.ModeledNamespace - Uncaught Throwable invoking method handler for methodId=NodeId{ns=8, id=92}.
org.eclipse.milo.opcua.stack.core.UaSerializationException: array length exceeds max message size (length=838860800, max=2097152)
at org.eclipse.milo.opcua.stack.core.serialization.OpcUaBinaryStreamDecoder.checkArrayLength(OpcUaBinaryStreamDecoder.java:1240)
at org.eclipse.milo.opcua.stack.core.serialization.OpcUaBinaryStreamDecoder.readByteString(OpcUaBinaryStreamDecoder.java:187)
at org.eclipse.milo.opcua.stack.core.serialization.OpcUaBinaryStreamDecoder.readByteString(OpcUaBinaryStreamDecoder.java:607)
at org.eclipse.milo.opcua.stack.core.types.structured.JoiningProcessIdentificationDataType$Codec.decode(JoiningProcessIdentificationDataType.java:125)
at org.eclipse.milo.opcua.stack.core.types.structured.JoiningProcessIdentificationDataType$Codec.decode(JoiningProcessIdentificationDataType.java:1)
at org.eclipse.milo.opcua.stack.core.serialization.codecs.GenericDataTypeCodec$GenericBinaryDataTypeCodec.decode(GenericDataTypeCodec.java:47)
at org.eclipse.milo.opcua.stack.core.types.OpcUaDefaultBinaryEncoding.decode(OpcUaDefaultBinaryEncoding.java:117)
at org.eclipse.milo.opcua.stack.core.types.builtin.ExtensionObject.lambda$0(ExtensionObject.java:105)

I cannot figure out why this happen, also I cannot figure out if eclipse milo is able to read a structure with optional fields 

please help 

--
Ing. Viscomi Francesco

Back to the top