on 05-20-2021 5:09 PM
Hello Experts,
I was exploring SAP Business Application Studio and trying to consume REST based webservice (no OData) in SAPUI5 /Fiori application. But while trying to invoke the service I am getting 404 Not Found Error,
Followed below steps,
1. Created the required destination in SAP BTP, as shown below,
2. Create SAP Fiori/UI5 Application,
- Create Basic MTA Project
- Create Managed Application Router
- Create SAPUI5 Freestyle App
3. Added the below configuration in xs-app.json,
{"authenticationType": "none","csrfProtection": false,"source": "^/FMM_RMS/(.*)$","destination": "FMM_RMS","target": "$1"}
4. REST API to consume,
/hr-tech/visibility-per/getVisibilityByEmployeeId?employeeId=FMM0001&date=2021-05-13
5. AJAX call in controller.js
$.ajax({// url:"/bd91c945-3a6a-48c5-9237-14d64031ba13.BP.nstestdemo-1.0.0/FMM_RMS/hr-tech/visibility-per/getVisibilityByEmployeeId?employeeId=FMM0001&date=2021-05-13",
url:"FMM_RMS/hr-tech/visibility-per/getVisibilityByEmployeeId?employeeId=FMM0001&date=2021-05-13",type:"GET",
async: true,headers:{accept:'application/json',
contentType:'application/json'},
success:function(data){
debugger;},
error:function(oError){
debugger;}});
No other file has been modified.
Please let me know which configuration/code I am missing.
Note: I was able to consume OData service seamlessly.
Regards,
Sharique
User | Count |
---|---|
64 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.