Hello everyone,
I am currently testing a mobile app using HTML5 in eclipse using the official SAPUI5 development kit. I almost have it working fully . Anyways, basically this program takes a external ODATA service and displays the data from it (product listing). It works inside my Eclipse environment preview but when i open it on my android phone (apk or local html file) there's an http data error ("Server error: HTTP request failed -" ) and no data is displayed. I have checked this webapp on my ipad (accessing localhost connection while the project is running in preview inside eclipse as well as my phone) and it shows the app but not the data (no error messages pop up). I believe I have it narrowed down to an issue this code in bold:
// data access
function getServiceUrl(sServiceUrl) {
var sOrigin = window.location.protocol + "//" + window.location.hostname
+ (window.location.port ? ":" + window.location.port : "");
if (!jQuery.sap.startsWith(sServiceUrl, sOrigin)) {
return "proxy/" + sServiceUrl.replace("://", "/");
} else {
return sServiceUrl.substring(sOrigin.length);
}
};
If i'm not mistaken this binds the public ODATA service to be used locally within the SAP network. I have tried a few things and still haven't had any luck. I will include the full code and a couple screenshots as attachments.
Any help would be greatly appreciated!
Thanks!