Skip to Content
avatar image
Former Member

SCP IoT Service Reading Registered Devices with OPENUI5

Hi everyone,

i try to read all registered devices from SCP IoT Service and store the response in a JSON Model. I want to load the data in my Component.js. This is the code i use to load the data:

//create "json" model
var oModel = new sap.ui.model.json.JSONModel();
//load data from URL
oModel.loadData("https://<host>/com.sap.iotservices.dms/v2/api/devices",
"", true, "GET", false, "false", {
Authorization: "Basic mybase64encrypted USER:PW"
});

When starting my application i get this error:

XMLHttpRequest cannot load https://<host>/com.sap.iotservices.dms/v2/api/devices". Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'myapplicationURL' is therefore not allowed access.

Has anyone a suggestion where I need to adopt the code?

Thanks for every help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers