Our client has changed its system to SAP and wants an app to display data via SAP interface. We decided to use the SAPUI5 framework + WebIDE to develop the app, since it provides a very good control variety with a solid MVC design as well as easy-to-use cloud connectors for the SAP interface.
We have configured a connector like this:
neo-app.json
{
"welcomeFile": "/webapp/index.html",
"routes": [
{
"path": "/resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/resources"
},
"description": "SAPUI5 Resources"
},
{
"path": "/test-resources",
"target": {
"type": "service",
"name": "sapui5",
"entryPath": "/test-resources"
},
"description": "SAPUI5 Test Resources"
},
{
"path": "/mynews",
"target": {
"type": "destination",
"name": "MyNews_CMS",
"preferLocal": true
}
}
],
"sendWelcomeFileRedirect": true
}
This is our test call in the component.js:
try {
$.get("/mynews/?json=2", function(data, status) {
alert("success: " + JSON.stringify(data));
}).fail(function(arg1) {
alert("error: " + JSON.stringify(arg1));
});
} catch (err) {
alert("global error: " + err);
}
In our WebIDE we get a full JSON with all the wanted data from the SAP connector API, however, as soon as we build the App and publish it on any device using HAT (Android, iOS, even signed), the request fails.
first, it alerts {}
(empty object), then it alerts error: {"readyState":0,"status":0,"statusText":"error"}
How can we solve this issue?