2024 Aug 12 9:51 AM - edited 2024 Aug 12 9:51 AM
Hi Experts,
I am facing problem of getting CORS error while calling Northwind oData Service to show data in my SAPUI5 Application created in BAS.
I am using 2 approaches here:
1. By Using the Rest API
By directly calling the Service URL through ODataModel, I am getting CORS error on this but while disabling the browser security I am getting the data perfectly.
2. By Configuring the Northwind Service to the Destination in BTP and try using the destination.
manifest.json
xs-app.json
since the preload is true, the destination is loading first to fetch the metadata,
I am getting this:
Please help me with this.
Hi,
1- direct url wont work here, and also if you use http://services.odata.org in your destination then also it will give CORS issue.
2- this is fine just you need to remove destination name from the uri in manifest file, it should be like below,
"dataSources": {
"mainService": {
"uri": "/V2/Northwind/Northwind.svc/",
"type": "OData",
"settings": {
"annotations": [],
"localUri": "localService/metadata.xml",
"odataVersion": "2.0"
}
}
}
hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
67 | |
8 | |
8 | |
6 | |
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.