【发布时间】:2016-01-11 20:42:41
【问题描述】:
我目前正在尝试订阅 Orion 和 Cosmos。发送到 Orion 的所有数据都在更新,没有任何问题。但是,当发布到 http://xxx.xxx.xx.xx:1026/v1/subscribeContext 时,我收到以下错误:
{
"subscribeError": {
"errorCode": {
"code": "400",
"reasonPhrase": "Bad Request",
"details": "JSON Parse Error"
}
}
}
这是我要发送的 json 字符串:
{
"entities": [
{
"type": "Location",
"isPattern": "false",
"id": "Device-1"
}
],
"reference": "http://52.31.144.170:5050/notify",
"duration": "PT10S",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [
"position"
]
}
],
"attributes": [
"position"
]
}
Orion 中更新 OK 的实体是:
{
"type": "Location",
"isPattern": "false",
"id": "Device-1",
"attributes": [
{
"name": "position",
"type": "coords",
"value": "24,21",
"metadatas": [
{
"name": "location",
"type": "string",
"value": "WGS84"
}
]
},
{
"name": "id",
"type": "device",
"value": "1"
}
]
}
我尝试了 readthedocs 中的许多不同示例,但 StackOverflow 中的其他响应均未成功。
哪种格式正确?我应该在使用 /contextEntities 更新 Orion 之前还是之后调用 /subscribeContext?
Orion Context Broker 版本为 0.26.1。
提前谢谢你。
【问题讨论】:
-
我已经基于 curl 进行了快速测试,您使用的逐字消息似乎没问题(请参阅gist.github.com/fgalan/f0f44d5113fa88e4825a)。请您做同样的测试以检查它在您的机器中的运行情况吗?
标签: fiware fiware-orion fiware-cygnus