Skip to Content

Access an IoT Service on HANA Trial from HANA Trial HTML5 App

Hi,

we are trying to call a HANA IoT Post service e.g. https://iotmms . hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/ >

However, this does not work for us. After following a description in

Communicate with IoT in your WebIDE project (here the push to device is described) .

when using the the sap.service.IOT.post of the IOT helper code in WEBIDE we get errors of type:

MLHttpRequest cannot load https://iotmms . hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/data/ >. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' https://fill-s0002907416trial.dispatcher.hanatrial.ondemand.com' is therefore not allowed access. The response had HTTP status code 401

Although there are some blogs stating that you cannot connect from a local HANATRIAL website to the local HANATRIAL .xsodata services, we wonder whether there is a way for the IoT services to be called locally on the trial landscape.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 28, 2016 at 07:05 AM

    Hi Marcus,

    as far as I understood you use that "IOT.js" helper library that you "injected" in WebIDE like described for example here [1]? Did you configure your destinations as well? Communication is supposed to be done via destinations otherwise you will face those CORS problems.

    Regards,

    Anton

    [1] Build IoT Applications using WebIDE

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Anton,

      after all I got the posting to the IOT services working.

      It was somewhat tedious to get the right ingrediences from the different tutorials:

      • Getting the destination settings in neo_app.json and on HANA trial
      • Authorization and the Bearer token in the post request
      • Using the IoT.js functions

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.