Repository: node-opcua/node-opcua

Issue #173: Form 2 of Browse seems to give incorrect results
Created: 2016-03-14T11:29:22Z
I'm using this public opc ua server 'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer'
when I do:
function(callback) {
  var browseDescription = {
     nodeId: "ns=0;i=84",
     referenceTypeId: "ns=0;i=35",
     browseDirection: 2
  };


   session.browse(browseDescription, function(err, browseResult, diags){
    if(!err) {
        console.log(" with browse description::", JSON.stringify(browseResult, null, '\t'));
    }
callback(err);
    });
},

I get these results..
 with browse description:: [
    {
            "statusCode": {
                    "value": 0,
                    "description": "No Error",
                    "name": "Good"
            },
            "references": [
                    {
                            "referenceTypeId": "ns=0;i=0",
                            "isForward": false,
                            "nodeId": "ns=0;i=85",
                            "browseName": {
                                    "namespaceIndex": 0
                            },
                            "displayName": {},
                            "nodeClass": "Unspecified",
                            "typeDefinition": "ns=0;i=0"
                    },
                    {
                            "referenceTypeId": "ns=0;i=0",
                            "isForward": false,
                            "nodeId": "ns=0;i=86",
                            "browseName": {
                                    "namespaceIndex": 0
                            },
                            "displayName": {},
                            "nodeClass": "Unspecified",
                            "typeDefinition": "ns=0;i=0"
                    },
                    {
                            "referenceTypeId": "ns=0;i=0",
                            "isForward": false,
                            "nodeId": "ns=0;i=87",
                            "browseName": {
                                    "namespaceIndex": 0
                            },
                            "displayName": {},
                            "nodeClass": "Unspecified",
                            "typeDefinition": "ns=0;i=0"
                    }
            ]
    }
]

however when I do:
function(callback) {
   session.browse('ns=0;i=84', function(err, browseResult){
    if(!err) {
      console.log('browse:', JSON.stringify(browseResult, null, '\t'));

    }
callback(err);
    });
},

I get:
browse: [
    {
            "statusCode": {
                    "value": 0,
                    "description": "No Error",
                    "name": "Good"
            },
            "references": [
                    {
                            "referenceTypeId": "ns=0;i=35",
                            "isForward": true,
                            "nodeId": "ns=0;i=85",
                            "browseName": {
                                    "namespaceIndex": 0,
                                    "name": "Objects"
                            },
                            "displayName": {
                                    "text": "Objects"
                            },
                            "nodeClass": "Object",
                            "typeDefinition": "ns=0;i=61"
                    },
                    {
                            "referenceTypeId": "ns=0;i=35",
                            "isForward": true,
                            "nodeId": "ns=0;i=86",
                            "browseName": {
                                    "namespaceIndex": 0,
                                    "name": "Types"
                            },
                            "displayName": {
                                    "text": "Types"
                            },
                            "nodeClass": "Object",
                            "typeDefinition": "ns=0;i=61"
                    },

(&c...)
I am wondering why the results from the first call would be different and seemingly incorrect

Duplicate issue #178: client.browse returning incomplete data with 'form2' & 'form4'
Created: 2016-03-18T13:22:10Z
browsing with a filter is giving me blank results for referenceTypeId &c for the returned references
I am using opc.tcp://opcua.demo-this.com:51210/UA/SampleServer
so when I do:
var browseDescription = {
   nodeId: 'RootFolder',
   referenceTypeId: 'Organizes',
   browseDirection: opcua.browse_service.BrowseDirection.Both 
 };

client.browse([browseDescription], function(err, browseResult){
              if(!err) {
                console.log(JSON.stringify(browseResult, null, '\t'));
I am getting:
[
        {
                "statusCode": {
                        "value": 0,
                        "description": "No Error",
                        "name": "Good"
                },
                "references": [
                        {
                                "referenceTypeId": "ns=0;i=0",
                                "isForward": false,
                                "nodeId": "ns=0;i=85",
                                "browseName": {
                                        "namespaceIndex": 0
                                },
                                "displayName": {},
                                "nodeClass": "Unspecified",
                                "typeDefinition": "ns=0;i=0"
                        },
                        {
                                "referenceTypeId": "ns=0;i=0",
                                "isForward": false,
                                "nodeId": "ns=0;i=86",
                                "browseName": {
                                        "namespaceIndex": 0
                                },
                                "displayName": {},
                                "nodeClass": "Unspecified",
                                "typeDefinition": "ns=0;i=0"
                        },
                        {
                                "referenceTypeId": "ns=0;i=0",
                                "isForward": false,
                                "nodeId": "ns=0;i=87",
                                "browseName": {
                                        "namespaceIndex": 0
                                },
                                "displayName": {},
                                "nodeClass": "Unspecified",
                                "typeDefinition": "ns=0;i=0"
                        }
                ]
        }
]


however if I do:
client.browse(['RootFolder'], function(err, browseResult){
              if(!err) {
                console.log(JSON.stringify(browseResult, null, '\t'));


I get:
[
        {
                "statusCode": {
                        "value": 0,
                        "description": "No Error",
                        "name": "Good"
                },
                "references": [
                        {
                                "referenceTypeId": "ns=0;i=35",
                                "isForward": true,
                                "nodeId": "ns=0;i=85",
                                "browseName": {
                                        "namespaceIndex": 0,
                                        "name": "Objects"
                                },
                                "displayName": {
                                        "text": "Objects"
                                },
                                "nodeClass": "Object",
                                "typeDefinition": "ns=0;i=61"
                        },
                        {
                                "referenceTypeId": "ns=0;i=35",
                                "isForward": true,
                                "nodeId": "ns=0;i=86",
                                "browseName": {
                                        "namespaceIndex": 0,
                                        "name": "Types"
                                },
                                "displayName": {
                                        "text": "Types"
                                },
                                "nodeClass": "Object",
                                "typeDefinition": "ns=0;i=61"
                        },
                        {
                                "referenceTypeId": "ns=0;i=35",
                                "isForward": true,
                                "nodeId": "ns=0;i=87",
                                "browseName": {
                                        "namespaceIndex": 0,
                                        "name": "Views"
                                },
                                "displayName": {
                                        "text": "Views"
                                },
                                "nodeClass": "Object",
                                "typeDefinition": "ns=0;i=61"
                        },
                        {
                                "referenceTypeId": "ns=0;i=40",
                                "isForward": true,
                                "nodeId": "ns=0;i=61",
                                "browseName": {
                                        "namespaceIndex": 0,
                                        "name": "FolderType"
                                },
                                "displayName": {
                                        "text": "FolderType"
                                },
                                "nodeClass": "ObjectType",
                                "typeDefinition": "ns=0;i=0"
                        }
                ]
        }
]

Closing comment (2016-03-20T15:01:20Z): similar to #173 ?