Topic RSS15:49, EEST
November 29, 2021
OfflineHi together,
We use the Java SDK 5.5.0 for the OPCUA client.
when migrating to prosys java sdk 5.x we discovered the following behavior:
From an OPCUA server (not implemented in prosys – unknown which provider) we must write a complex type.
We do not know the Structure in advance, but instead we only know the field names.
Thus, we get the StructureSpecification from the DataType Node and create a new AbstractStructure using
AbstractStructure abstractStructure = (AbstractStructure) specification.toInstanceBuilder().build();
If a label name is x whose value should be set to y, we call
abstractStructure.set(x,y)
This worked fine until migrating to version 5.x
Then we receive an IllegalArgumentException at the method ‘validateField’
The reason is that the server sends us 7 field specifications with field indices 0,1,2,3,4,6,8
In my opinion thats clearly wrongly defined in the server.
However, its hard, time-consuming, and expensive to change that in the server.
Is there a way to handle this in the client side?
Essentially, I cant call any method in the AbstractStructure, neither setting nor getting values with fieldIndices 6 or 8
Many thanks for your help!
10:42, EEST
April 3, 2012
OfflineHi,
It is unlikely that a pre-5.x working Structure thing would have been defined wrong in the server, if it works it needs both sides to be basically exactly correct. I think we might actually have a bug in the client side, this thing has gotten quite a lot of internal changes. Could you verify the following: By “field index”, do you mean FieldSpecification.getFieldIndex()? If yes, is FieldSpecification.isArray() true for “index 6 and 8” and false for all others?
If you can access the server, using UaExpert or our https://prosysopc.com/products…..a-browser/ is the DataTypeDefinition Attribute for the Structure DataType node ‘Bad_AttributeInvalid’ or does it show a StructureDefinition? I would assume Bad_AttributeInvalid, though if it is StructureDefinition that doesn’t necessarily rule out the scenario I have in mind. Will do some investigating..
12:25, EEST
November 29, 2021
OfflineHi,
by field index I mean FieldSpecification.getFieldIndex() yes.
For both indices 6 and 8, the method isArray() returns true and false for all others.
I will check this afternoon using uaExpert.
Maybe another relevant info: arrayDimension is null for both arrays, which also seems wrong. However, this was also working before..
To me it looks like the AbstractStructure/DynamicStructure are handling values of FieldSpecifications differently since version 5.x.
Before, it was working without the fieldIndex and now it seems to be using it
1 Guest(s)

Log In
Register