FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.12k stars 361 forks source link

Problem analyzing OPCUA Server root types. Unexpected DataTypeDefinition attribute found #1082

Open emiliodiritaRA opened 2 years ago

emiliodiritaRA commented 2 years ago

I have an OPCUA client which import OPCUA server nodes. Of course I need to import all types before import instances. I notice something strange exploring your python OPCUA server example (./examples/server-example.py) with UA Expert All root types, BaseEventType, BaseInterfaceType, BaseObjectType, References and BaseVariableType have DataType icon, while they should have Type icon. I immediately check the NodeClass attributes of those items, and they are correct. So I do not understand why they are recognised as DataTypes. What I found strange is that they have "DataTypeDefinition" attribute specified (the new opcua specification attribute for Structures and Enums). This attribute is specified only for them, not for subTypes. I think this can create problems navigating with references and check type consistency. The attribute on root types is something that you put intentionally? If yes, why?

To Reproduce
Start the example server (./examples/server-example.py) and connect with UAExpert

Expected behavior
DataTypeDefinition attribute not present on root types (BaseEventType, BaseInterfaceType, BaseObjectType, References and BaseVariableType)

Screenshots
image image

Version
Python-Version: 3.10.2
opcua-asyncio Version (e.g. master branch, 0.9): master (f2ff44b8cbf00da7ac184d03b9106166f08c70b5)

schroeder- commented 2 years ago

This this patch help #937 with the problem?

emiliodiritaRA commented 2 years ago

Unfortunately not. I write a comment in the referenced issue