【发布时间】:2015-04-14 13:25:49
【问题描述】:
我正在两台 CentOS 6.6 机器上尝试 orion 上下文代理通信。在我做的目标机器上:
./accumulator-server.py 1028 /accumulate mywebpage.lan on
在我的本地机器上我做了:
[DevF12@localhost ~]$ (curl mywebpage.lan:1028/v1/updateContext -s -S --header 'Content-Type: application/json' --header 'Accept: application/json' -d @- | python -mjson.tool ) <<EOF
> {
> "contextElements": [
> {
> "type": "Room",
> "isPattern": "false",
> "id": "Room2",
> "attributes": [
> {
> "name": "temperature",
> "type": "float",
> "value": "777"
> },
> {
> "name": "pressure",
> "type": "integer",
> "value": "711"
> }
> ]
> }
> ],
> "updateAction": "APPEND"
> }
> EOF
目标机器上的结果是:
POST http://mywebpage.lan:1028/v1/updateContext
Content-Length: 456
User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Host: mywebpage.lan:1028
Accept: application/json
Content-Type: application/json
{ "contextElements": [ { "type": "Room", "isPattern": "false", "id": "Room2", "attributes": [ { "name": "temperature", "type": "float", "value": "777" }, { "name": "pressure", "type": "integer", "value": "711" } ] } ], "updateAction": "APPEND"}=======================================
192.168.1.11 - - [14/Apr/2015 15:07:36] "POST /v1/updateContext HTTP/1.1" 200 -
我从本地机器得到的消息是:
No JSON object could be decoded
那么,这一切意味着什么?
1. 200代码是不是说创建Room2成功了?
2。那为什么我会收到无法解码 JSON?
3.所有这些都带来了另一个问题,这是否意味着气象站described in my previous post 也必须在 CentOS 上运行才能发送上下文代理消息?
【问题讨论】:
标签: fiware fiware-orion