on 07-18-2021 7:29 PM
Hello All,
Here i am trying to use third party APIs which is related to other SAP systems. initially i tried it to call using ajax calls but i am getting CORS error. so i thought if we use destination to call external APIs may be it will over come CORS issue. so tried to add new destination in BTP.
and i tried to add manually another destination in the 'xs-app.json' file, but i am not able to call that destination in ajax service call.
this is the code added manually in xs-app.json.
{
"source": "^/(.*)$",
"target": "/$1",
"destination": "cpi_system",
"authenticationType": "xsuaa",
"csrfProtection": false
},
here is my ajax call code.
var url = "/cpi_system/EmpDataCloning?SFObject=";
var settings = {
"async": true,
"crossDomain": true,
"url":url
}
$.ajax(settings).done(function (response) {
console.log(response);
});
but when i run the application this ajax call take origin as my BAS dynamic running app domain.
so for that i could not receive the data from this service call and its throwing CORS error.
can any one please help me with this issue.
Regards,
Praveen
Hi Praveen, Kindly check this related question and the comments under Marius' answer: https://answers.sap.com/questions/13323065/sap-business-application-studio-multiple-rest-api.html
Regards, Merlin
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 | |
8 | |
8 | |
6 | |
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.