1

到目前为止,我一直在使用在 Fi-Lab/Cloud 中创建的独立模式下的上下文代理实例,并使用 psb-orion-image。现在我想将该 CB 的一个实例与 http//orion.lab.fi-ware.org 联合。我使用 XML 表单来创建、更新......并且要联合的实例的名称是“UPCT:TEMPERATURE:SENSOR”,而传感器类型是“UPCT:SENSOR”。

因此,通过 SSH 连接,我发送下一个表单:

(curl localhost:1026/NGSI10/subscribeContext -s -S --header 'Content-Type: application/xml' -d @- | xmllint --format -) <<EOF
<?xml version="1.0"?>
<subscribeContextRequest>
  <entityIdList>
    <entityId type="UPCT:SENSOR" isPattern="false">
      <id>UPCT:TEMPERATURE:SENSOR</id>
    </entityId>
  </entityIdList>
  <reference>http://orion.lab.fi-ware.eu:1026/ngsi10/notifyContext</reference>
  <duration>P1M</duration>
  <notifyConditions>
    <notifyCondition>
      <type>ONCHANGE</type>
      <condValueList>
        <condValue>temperature</condValue>
      </condValueList>
    </notifyCondition>
  </notifyConditions>
  <throttling>PT5S</throttling>
</subscribeContextRequest>
EOF

我得到了正确的答复,带有订阅 ID。但是,如果我更新实例的 de contextValue 并尝试向http://orion.lab.fi.ware.eu:1026发送查询,则会收到错误消息:

-:1: 解析器错误:需要开始标记,'<' not found Auth-token not found in request header ^

我想我应该得到与我更新到我的实例相同的值,如中所示

https://forge.fi-ware.org/plugins/mediawiki/wiki/fiware/index.php/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_User_and_Programmers_Guide#Context_Broker_Federation

我需要知道出了什么问题,以及我如何才能对全球 CB 做联邦调查。

谢谢

4

1 回答 1

0

该错误消息是由于发送到 orion.lab.fi-ware.org 上的 Orion 实例的任何请求(包括其他 Orion 实例发送的通知)都必须使用身份验证。目前(即 0.14.1 版),Orion 未在通知中包含身份验证所需的 X-Auth-Token(请参阅程序员的快速入门)。

但是,通常的用例是将 orion.lab.fi-ware.org 上的 Orion 与私有 Orion 用户实例(即 orion.lab.fi-ware.org -> 你的 Orion)联合,而不是以相反的方式(即你的 Orion - > orion.lab.fi-ware.org),正如您正在尝试的那样。鉴于您通常想要做的是将公共信息(例如桑坦德市传感器)与私人信息(例如由您的传感器产生的信息)合并。以这种方式联合 orion.lab.fi-ware.org -> 你的 Orion 应该可以完美运行。

编辑: Orion 0.14.1 中的限制已被克服当前 Orion 版本(2.0.0)在通知中传播 X-Auth-Token 标头(我不记得 0.14.1 和 2.0.0 之间的确切版本,抱歉...)

于 2014-08-13T06:15:17.870 回答