{"action":"created","issue":{"url":"https://api.github.com/repos/acplt/open62541/issues/172","labels_url":"https://api.github.com/repos/acplt/open62541/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/acplt/open62541/issues/172/comments","events_url":"https://api.github.com/repos/acplt/open62541/issues/172/events","html_url":"https://github.com/acplt/open62541/issues/172","id":58312821,"number":172,"title":"Problem with nodeId.identifierType = UA_NODEIDTYPE_STRING","user":{"login":"kadomcev","id":11058275,"avatar_url":"https://avatars.githubusercontent.com/u/11058275?v=3","gravatar_id":"","url":"https://api.github.com/users/kadomcev","html_url":"https://github.com/kadomcev","followers_url":"https://api.github.com/users/kadomcev/followers","following_url":"https://api.github.com/users/kadomcev/following{/other_user}","gists_url":"https://api.github.com/users/kadomcev/gists{/gist_id}","starred_url":"https://api.github.com/users/kadomcev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadomcev/subscriptions","organizations_url":"https://api.github.com/users/kadomcev/orgs","repos_url":"https://api.github.com/users/kadomcev/repos","events_url":"https://api.github.com/users/kadomcev/events{/privacy}","received_events_url":"https://api.github.com/users/kadomcev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-20T05:46:15Z","updated_at":"2015-02-20T09:39:42Z","closed_at":null,"body":"Hi all.\r\nTrying to change the node type to a string.\r\n\r\n    UA_VariableNode *tmpNode = UA_VariableNode_new();\r\n    sprintf(str,\"Byte\");\r\n    UA_QualifiedName_copycstring(str,&tmpNode->browseName);\r\n    UA_LocalizedText_copycstring(str,&tmpNode->displayName);\r\n    UA_LocalizedText_copycstring(\"\", &tmpNode->description);\r\n\r\n    tmpNode->nodeId.namespaceIndex = 2;\r\n    char a[] = \"Demo\";\r\n    tmpNode->nodeId.identifierType = UA_NODEIDTYPE_STRING;\r\n    tmpNode->nodeId.identifier.string.data = (UA_Byte*)a;\r\n    tmpNode->nodeId.identifier.string.length = strlen(a);;\r\n    tmpNode->nodeClass = UA_NODECLASS_VARIABLE;\r\n\r\n    tmpNode->value.vt = &UA_TYPES[UA_INT32];\r\n    tmpNode->value.storage.data.dataPtr = &data;\r\n    tmpNode->value.storageType = UA_VARIANT_DATA_NODELETE;\r\n    tmpNode->value.storage.data.arrayLength = 1;\r\n\r\n    UA_Server_addNode(server, (const UA_Node**)&tmpNode,\r\n                      &UA_EXPANDEDNODEIDS[UA_OBJECTSFOLDER],\r\n                      &UA_NODEIDS[UA_HASCOMPONENT]);\r\n\r\nUaExpert Client:\r\nListening for TCP connections on 0.0.0.0:16664\r\nSL_processMessage - unknown request, namespace=0, request=787\r\nThe message size was not as announced or the message could not be processed, ski\r\npping to the end of the message.\r\n\r\nNode does not appear on the server, prompt please, what is the problem?"},"comment":{"url":"https://api.github.com/repos/acplt/open62541/issues/comments/75211900","html_url":"https://github.com/acplt/open62541/issues/172#issuecomment-75211900","issue_url":"https://api.github.com/repos/acplt/open62541/issues/172","id":75211900,"user":{"login":"jpfr","id":1726411,"avatar_url":"https://avatars.githubusercontent.com/u/1726411?v=3","gravatar_id":"","url":"https://api.github.com/users/jpfr","html_url":"https://github.com/jpfr","followers_url":"https://api.github.com/users/jpfr/followers","following_url":"https://api.github.com/users/jpfr/following{/other_user}","gists_url":"https://api.github.com/users/jpfr/gists{/gist_id}","starred_url":"https://api.github.com/users/jpfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpfr/subscriptions","organizations_url":"https://api.github.com/users/jpfr/orgs","repos_url":"https://api.github.com/users/jpfr/repos","events_url":"https://api.github.com/users/jpfr/events{/privacy}","received_events_url":"https://api.github.com/users/jpfr/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T09:39:42Z","updated_at":"2015-02-20T09:39:42Z","body":"Hey @kadomcev ,\r\n\r\ntry the current master. I fixed a bug related to nodeid handling.\r\nThis works for me:\r\n```c\r\n    UA_VariableNode *tmpNode = UA_VariableNode_new();\r\n    char str[15];\r\n    sprintf(str,\"Byte\");\r\n    UA_QualifiedName_copycstring(str,&tmpNode->browseName);\r\n    UA_LocalizedText_copycstring(str,&tmpNode->displayName);\r\n\r\n    tmpNode->nodeId.namespaceIndex = 2;\r\n    UA_String_copycstring(\"Demo\", &tmpNode->nodeId.identifier.string);\r\n    tmpNode->nodeId.identifierType = UA_NODEIDTYPE_STRING;\r\n    tmpNode->nodeClass = UA_NODECLASS_VARIABLE;\r\n\r\n    tmpNode->value.vt = &UA_TYPES[UA_INT32];\r\n    tmpNode->value.storage.data.dataPtr = myInteger;\r\n    tmpNode->value.storageType = UA_VARIANT_DATA_NODELETE;\r\n    tmpNode->value.storage.data.arrayLength = 1;\r\n\r\n    UA_Server_addNode(server, (const UA_Node**)&tmpNode,\r\n                      &UA_EXPANDEDNODEIDS[UA_OBJECTSFOLDER],\r\n                      &UA_NODEIDS[UA_ORGANIZES]);\r\n```"}}