on 11-23-2021 12:36 PM
Hi,
I have the following problem:
I cannot reach a non-oData destination from the sapui5 app developed in SAP BAS.
The requests are not routed to the destination in SAP BAS, but they are routed when the app is deployed in SAP BTP.
I have defined the following non-OData destination in BTP:
When I deploy the app to SAP BTP, the AJAX requests to this destination are correctly routed and data is retrieved.
But they are not routed in the SAP BAS when I want to test the app during development.
I tried to bind this destination using Run Configuration:
I can select this destination using Run Configuration option, then Connect to SAP system...
but when I pick the WeatherAPI, and run the application:
the requests are not routed to the destination. The same app works correctly when deployed in BTP.
How should I correctly bind the destination in SAP BAS?
With best regards,
Krzysztof Bulanowski
Hi Krzysztof,
first I would suggest that you learn some more basics for SAPUI5 and start with the Walkthrough and learn about Step 7: JSON Model.
To avoid not needed requests you should remove:
"mainService": {
"uri": "/sap/opu/odata/",
"type": "OData",
"settings": {
"annotations": [],
"localUri": "localService/metadata.xml",
"odataVersion": "4.0"
}
},
and:
,
"": {
"dataSource": "mainService",
"preload": true,
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect": true,
"earlyRequests": true,
"groupId": "$direct"
}
}
from the manifest.json.
To fix the issue with the API connection you should replace:
- path: /sap
url: http://localhost
with:
- path: /Weather
pathPrefix: /
url: https://api.openweathermap.org
destination: WeatherAPI
in the ui5.yaml.
And finally replace test/flpSandbox.html with index.html in the package.json start script.
I've then got this result:
CU
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gregor Wolf,
I have application where i am calling third party API. I am able to connect to API and get response when deployed it to CF but not able to run it locally. It gives me error 404.
I have changed path in ui5.yaml file already
Also binding my Destination for API in local BAS is done
This is what i have in menifest.json for datasource and model section.
"dataSources": { "mainService": { "uri": "gvp/Public", "type": "OData", "settings": { "annotations": [], "localUri": "localService/metadata.xml", "odataVersion": "2.0" } } } "models": { "i18n": { "type": "sap.ui.model.resource.ResourceModel", "settings": { "bundleName": "testrailapi.i18n.i18n" } }, "": { "dataSource": "mainService", "preload": true, "settings": {} } },can you please help here with what else we need to do to make it work locally in business application studio (BAS).
Regards,
Chaitali Desai
User | Count |
---|---|
85 | |
11 | |
10 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.