To test I created a very simple server with the default node tree + 2 userdefined ones.
I am creating nodes in different Namespaces. For example Nodes with typedef FolderType that link to eachother
Root->Objects->FolderNs2->FolderNs3. ( see picture attached)
This by using the following API: ( I left out the obvious things as creating the browsename nodemanager etc etc).
Creating (for example) Folder nodes (typedef does not matter for my question for the sake of simplicity i choose Folders here):
Code: Select all
UaGenericObject* pFolderObject2 = new UaGenericObject(
UaNodeId(102,2), //const UaNodeId& nodeId,
browse_name, //const UaQualifiedName& browseName,
display_name, //const UaLocalizedText& displayName,
description, //const UaLocalizedText& description,
UaNodeId(61,0), //const UaNodeId& typeDefinitionId, HasTypeDefinition FolderType
0);
pNodeManagerConfig->addUaNode(pFolderObject2);
// creates references from Object node -> Folder2 Node
pNodeManagerConfig->addUaReference(UaNodeId(85,0), UaNodeId(102,2), UaNodeId(35,0));
Except when i want to create a reference to a node in NS0. For example my Type defined in Ns2 has a property defined in Ns0 (or Namespace Root). This gives a browse issue.
So I can also create a folder object in NS0 which i reference as follows:
Code: Select all
UaGenericObject* pFolderObjectns0 = new UaGenericObject(
UaNodeId(100000,0), //const UaNodeId& nodeId,
browse_name, //const UaQualifiedName& browseName,
display_name, //const UaLocalizedText& displayName,
description, //const UaLocalizedText& description,
UaNodeId(61,0), //const UaNodeId& typeDefinitionId, HasTypeDefinition FolderType
0);
pNodeManagerConfigRoot->addUaNode(pFolderObjectns0);
pNodeManagerConfigRoot->addUaReference(UaNodeId(102,2), UaNodeId(100000,0), UaNodeId(35,0));
Above will result in a stackoverflow because of the following (see trace)
Starting Node = NS2|Numeric|102
11:39:08.073Z|7|062C* Number of path elements = 1
11:39:08.073Z|7|062C* Path element [0]
11:39:08.087Z|7|062C* TargetName = ns=0|Icon
11:39:08.087Z|7|062C* IsInverse = 0
11:39:08.101Z|7|062C* ReferenceTypeId = NS0|Numeric|46
11:39:08.101Z|7|062C* IncludeSubtypes = 0
11:39:08.101Z|6|062C* --> NodeManagerRoot::translateBrowsePathToNodeId
11:39:08.115Z|6|062C* --> NodeManagerUaNode::translateBrowsePathToNodeId NS=2
11:39:08.128Z|6|062C* --> NodeManagerRoot::translateBrowsePathToNodeId
11:39:08.128Z|6|062C* --> NodeManagerUaNode::translateBrowsePathToNodeId NS=2
11:39:08.142Z|6|062C* --> NodeManagerRoot::translateBrowsePathToNodeId
11:39:08.156Z|6|062C* --> NodeManagerUaNode::translateBrowsePathToNodeId NS=2
11:39:08.156Z|7|008C* --> UaSubscription::checkPublishTimer [SubID=2]
11:39:08.170Z|7|008C* <-- UaSubscription::checkPublishTimer time=100
11:39:08.170Z|6|062C* --> NodeManagerRoot::translateBrowsePathToNodeId
11:39:08.184Z|6|062C* --> NodeManagerUaNode::translateBrowsePathToNodeId NS=2
11:39:08.198Z|6|062C* --> NodeManagerRoot::translateBrowsePathToNodeId
11:39:08.198Z|6|062C* --> NodeManagerUaNode::translateBrowsePathToNodeId NS=2
11:39:08.226Z|6|062C* --> NodeManagerRoot::translateBrowsePathToNodeId
11:39:08.226Z|6|062C* --> NodeManagerUaNode::translateBrowsePathToNodeId NS=2
.....
Until we have a stack overflow reported by the debugger
If I create the pFolderObjectns0 under a NS0 node in the tree for example Objects the browse works fine. Since the nodemanager for Ns0 is different than Ns1 i also tested by creating references to Ns1 and those work fine just like Ns2 -> Ns3.
This could be either related to NodeManager Ns0 or Ns2 but i only see this translateBrowsePathToNodeId issue when referencing to a node in Ns0. The Nodemanager for Ns0 is a different nodemanager since this one is by default created and fetched by getNodeManagerRoot also looking at the header files I see its implemented by deriving from a different base-class than the others.
I would like to now why I am not able to create references to Ns0 do you need to do something special like connectingStarting Nodes (which i tried but didnt help).
Any suggestions are appreciated,