3

Trying to connect to my Orion CB which has entities created via IoTAgentCPP/IDAS. Both are of latest Docker version (okt 30 2015). All works fine using the FIGWAY Python scripts: Creating IDAS Service, Register Device, Send Observation, see Entity created and changed attributes via OCB.

But using any WireCloud Mashup widget like the NGSI Browser Widget that sends NSGI requests to the OCB the widget remains blanc, since the OCB sends back:

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

This reply is also received when querying via curl: curl my_remote_ocb_host:1026/v1/contextEntities -S --header 'Accept: application/json'

If I add the header --header 'Fiware-Service: fiwareiot' (which was specified when creating the IoT service w IDAS) to the curl-command line, then I get expected responses from the OCB.

However, the Widgets and Operators in WC have no means to add the Fiware-Service HTTP-Header. This is what I receive from WC via the Lab proxy, using protocol capture, at the OCB host:

POST /v1/queryContext?limit=20&details=on&offset=0 HTTP/1.1
Host: <myhost>:1026
origin: https://mashup.lab.fiware.org
Cookie: ..
Content-Length: 45
via: 1.1 mashup.lab.fiware.org (Wirecloud-python-Proxy/1.1)
accept-language: en-US,en;q=0.8,de;q=0.6,fr;q=0.4,nl;q=0.2,it;q=0.2
accept-encoding: gzip, deflate
x-forwarded-host: <myhost>:1026
x-forwarded-for: ..
accept: application/json
user-agent: ..
connection: keep-alive
x-requested-with: XMLHttpRequest
referer: https://mashup.lab.fiware.org/justb4/GeonovumTemperature1
X-Auth-Token: ..
content-type: application/json

{"entities":[{"id":".*","isPattern":"true"}]}

Response: HTTP/1.1 200 OK
Content-Length: 94
Content-Type: application/json
Date: Sat, 31 Oct 2015 13:23:44 GMT

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

Possibly the settings for WC Widgets/Operators need to be extended to allow for Fiware-Service HTTP headers, or is there another way for doing this using the current possibilities?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92

1 Answers1

3

WireCloud supports adding the FIWARE-Service header when programming widgets and operators (see the documentation for more info). So this can be fixed by updating the basic set of widgets and operators provided in FIWARE Lab to support the FIWARE-Service header.

I have created an ticket in the issue tracker of the NGSI Browser widget for you. Please, create such a ticket for the other widgets/operators.

NOTE: You can go to the issue tracker of a component if opening their details and clicking on the issue tracker button: enter image description here

Álvaro Arranz
  • 2,015
  • 1
  • 13
  • 22
  • Ok, thanks Álvaro. I can confirm that it is a matter of configuring (in prefs) and adding the Fiware-service HTTP header. As a quick hack I modified main.js in the browser devtools to add the header to the NGSIConnection object and it worked! Later uploading a modified WGT. Yes, all NGSI-related Operators/Widgets should be fixed via GH issues. – Just van den Broecke Nov 05 '15 at 13:45
  • I've updated the ngsi-browser widget, also in the marketplace ;-). Please, if you create the tickets I will be able to fix them faster because I have other tasks :(. – Álvaro Arranz Nov 05 '15 at 13:51