Skip to content

READRESPONSE has a strange format #40

Description

@atimin

Describe the bug

I've tried to read the value of a variable and got the following response:

{
    "Header": {
        "MessageType": "READ_RESPONSE",
        "ClientHandle": "1"
    },
    "Body": {
        "Value": {
            "Type": "1",
            "Body": "true"
        },
        "SourceTimestamp": "2019-07-26T11:10:20Z",
        "ServerTimestamp": "2019-07-26T11:10:20Z"
    }
}

First of all, the type is wrong anf equals 1. And I think, if variable 'Boolean' has type Boolean, the body should be true not string "ture".

To Reproduce

  1. Run demo application:
docker-compose run  -p 8080:8080 -p 8081:8081 -p 8082:8082 webserver
  1. Launch script:
  import websocket
  import json

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

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

Expected behavior

The expected message should be:

{
    "Header": {
        "MessageType": "READ_RESPONSE",
        "ClientHandle": "1"
    },
    "Body": {
        "Value": {
            "Type": "Boolean",
            "Body": "true"
        },
        "SourceTimestamp": "2019-07-26T11:10:20Z",
        "ServerTimestamp": "2019-07-26T11:10:20Z"
    }
}

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