cancel
Showing results for 
Search instead for 
Did you mean: 

HCP IoT push to device from ui5 application

peter_lans4
Explorer
0 Kudos

Hello,

I am currently trying to push data from a UI5 application via the HCP IoT push service to my Raspberry Pi using a websocket.

From the cockpit, this works fine. Raspberry responds as expected.

From my UI5 application, I keep running into a cross-domain error. The error received is:

XMLHttpRequest cannot load https://iotmmss0011948141trial.hanatrial.ondemand.com/com.sap.iotservices.mms/v1/api/http/push/749d6.... Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://webidetesting0665190-s0011948141trial.dispatcher.hanatrial.ondemand.com' is therefore not allowed access. The response had HTTP status code 401.

How do I overcome this problem?

Thanks in advance for your help.

Kind regards,

Peter Lans

Accepted Solutions (1)

Accepted Solutions (1)

anton_levin
Advisor
Advisor
0 Kudos

Hi Peter,

you overcome it by configuring a HTTP destination for your app SAP HANA Cloud Platform

An IoT Starter Kit consumption/push example also uses it iot-starterkit/src/apps/java/consumption at master · SAP/iot-starterkit · GitHub

Regards,

Anton

peter_lans4
Explorer
0 Kudos

Hi Anton,

Thanks for having me look into my destinations again.

I made a typo in specifying the destination in my application.

Now there's only a 400-bad request. I made another error in the request itself. I'll just have to review the final request in order to solve that one.

Regards,

Peter

Answers (0)