[Fiware-robotics] Demo web page + RCM demo

Iñigo Gonzalez igonzalez at ikergune.com
Thu Jan 29 11:28:43 CET 2015


Hi,

the web app is just a web page that is hosted in our fiware machine.
What it does is to send ajax calls to the different REST services:

- Context broker
- RCM

So to do this functionality we need support for cross origin request, in
our case as we need something to reach the context broker we have
created our context broker proxy, which supports cross origin and
redirects the requests to the context broker.

In your case, your service should provide support for cross origin so
the web app could reach to it. To achieve this, what is needed is just
to add support in your server to the OPTIONS request and both OPTIONS
and GET methods return the following headers in the response:

header("Access-Control-Allow-Headers", "api-version, content-length,
content-md5, content-type, date, request-id, response-time")
header("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE")
header("Access-Control-Expose-Headers", "api-version, content-length,
content-md5, content-type, date, request-id, response-time")
header("Access-Control-Allow-Origin", "*")

Regards,
Iñigo


On 29/01/15 10:30, Colombatto Davide wrote:
> Hi Inigo and all,
>
> I re-attach the document sent by Angel yesterday.
>
> If the arch in the document is used there would be no cross-domain problems for connection 4:
> the web-app should work as "intermediate" between the browser and the RCM and NOT the browser contacts directly the RCM with Javascript/AJAX.
>
>
> Use case:
> - Browser contacts your web-app for the page with the 3 buttons
> - When the user click on START and STOP, the browser contacts (with Javascript/AJAX) your web-app and the web-app performs this contacting RCM itself.
> - When your web-app obtains the XML response by RCM, the web-app responses to the browser
>
> I think this use case does not create cross domain on your side (no cross-domain Server2Server connection).
>
>
> Davide
>
>
> ________________________________________
> Da: Iñigo Gonzalez [igonzalez at ikergune.com]
> Inviato: giovedì 29 gennaio 2015 9.54
> A: fiware-robotics at lists.fi-ware.org
> Cc: Colombatto Davide
> Oggetto: Demo web page + RCM demo
>
> Hello Davide et al,
>
> Please note that I am moving this conversation to the robotics list so we do not overload everyone's inbox.
> I have just added to the demo webpage the urls sent by Daide. I have tried to launch the start command and found this issue:
>
> "XMLHttpRequest cannot load http://188.15.109.226:8088/platform/?command=SL&sc_host=localhost&sc_port=11312&package=turtlesim&name=monosim&_=1422520888499. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access."
>
> This issue is related to what Angel said in his mail yesterday. When calling to a REST service from a web page the cross origin security policy appears. So your api must add support to cross origin to allow the web page to connect to it.
>
> Please let us know when this is fixed so we can give it another try.
>
> Regards,
> Iñigo
>
> Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.
>
> This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.
>




More information about the Fiware-robotics mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy