on 06-22-2023 10:17 AM
Hello all,
I am developing UI5 application using SAP HANA Cloud Database and Spring boot API ( I deployed Spring boot app in Cloud foundry and deployed API working properly). I am getting issue while fetching API in UI5 application through ajax call. I am consuming API as a BTP Destination. following is my destination:
I am providing destination in xs-app.json:
I am calling API in ajax call. I have tried with absolute URL and relative URL both like /EmployeeDest/employees and EmployeeDest/employees, one is given in screen shot.
I am facing 404 issue while fetching API in UI5 application (without deploying):
And after UI5 app deployment I am getting 500 Error:
I have tried many solution and follow one blog, but nothing works.
Please guide me for issue.
Thanks.
Hi shubhmis,
Thanks for responding. My problem has been resolved now. I have changed in ui5.yaml as you said and do more changes. Like in ui5.yaml file I changed as follows:
customMiddleware:
- name: fiori-tools-proxy
afterMiddleware: compression
configuration:
ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted
ui5:
path:
- /resources
- /test-resources
url: https://ui5.sap.com
backend:
- path: /employees
destination: EmployeeDest
I changed my in xs-app.json as follows:
{
"source": "^/(.*)$",
"target": "/$1",
"destination": "EmployeeDest",
"authenticationType":"none"
},
And My ajax call URL is:
url: appModulePath + "/employees",
Since I am using Managed Approuter, I need to use App module path (In case of Standalone Approuter we use Application ID). I got app module path using this code:
var appId = this.getOwnerComponent().getManifestEntry("/sap.app/id");
var appPath = appId.replaceAll(".", "/");
var appModulePath = jQuery.sap.getModulePath(appPath);
My problem is resolved using this configurations.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.