SpagoBI 集成需要 v1/queryContext 的问题

Problems with v1/queryContext needed for SpagoBI integration

Orion CB 1.7.0 版本 运行 docker Docker 版本 Windows, 如果我创建一个简单的 object 做 POST http://localhost:1026/v1/updateContext

与 body:

{
    "contextElements": [
        {
            "type": "Car",
            "id": "myNewCar",
            "attributes": [
                {
                    "name": "maxSpeed",
                    "type": "integer",
                    "value": "220"
                }
            ]
        }
    ],
    "updateAction": "APPEND"
}

我得到答案:

{
  "contextResponses": [
    {
      "contextElement": {
        "type": "Car",
        "isPattern": "false",
        "id": "myNewCar",
        "attributes": [
          {
            "name": "maxSpeed",
            "type": "integer",
            "value": ""
          }
        ]
      },
      "statusCode": {
        "code": "200",
        "reasonPhrase": "OK"
      }
    }
  ]
}

然后,如果我使用相同的 headers 和相同的组件 body

POST http://localhost:1026/v1/queryContext
{
    "entities": [
        {
            "type": "Car",
            "isPattern": "false",
            "id": "myNewCar"
        }
    ]
}

我得到以下信息:

{
  "errorCode": {
    "code": "404",
    "reasonPhrase": "No context element found"
  }
}

如果不需要与 SpagoBI 等数据表示工具集成,这应该没有问题(例如,我可以使用 v2 API 查询实体),如 http://spagobi.readthedocs.io/en/latest/user/NGSI/README/

我能做什么?我在上下文规定方面做错了什么?

谢谢!

我的问题是我使用的是 API 的导入 Postman collection(从 https://github.com/telefonicaid/fiware-orion/tree/develop/doc/apiary/v2 下载),不小心我使用了 header Fiware-Service.

你是对的,你的测试工作正常。

感谢及时回复!!