Skip to content

Wrong status of a varibale in READRESPONSE. #41

Description

@atimin

Describe the bug

If a variable in the OPC UA server has a not success status, it is copied in READRESPONSE as a number. In other situations, the status code has a string value, for an example 'BadInvalidNodeId'.

To Reproduce

  import websocket
  import json

   msg = {
      'Header': {
        'MessageType':'READ_REQUEST',
        'ClientHandle':'1'
      },
      'Body': { 'Variable' : 'TestVariableWithBadStatus'}
   }

 
  ws = websocket.create_connection('ws://127.0.0.1:8081')
  ws.send(json.dumps(msg)) 
  resp = ws.recv()  
  print(resp)

Results:

{
    "Header": {
        "MessageType": "READ_RESPONSE",
        "ClientHandle": "1"
    },
    "Body": {
        "Value": {
            "Type": "12",
            "Body": "Hello, worldi1111!"
        },
        "Status": "2157641728",
        "SourceTimestamp": "2019-07-27T06:58:53Z",
        "ServerTimestamp": "2019-07-27T11:58:53Z"
    }
}

Expected behavior

The status should be:

   "Status": "BadNoData",

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions