Hello everyone,
an application, which is host on SCP Cloud Foundry, should call a (none odata) web service to upload something. The destination of the web service is configured via BTP cockpit (subaccount --> Connectivity --> Destinations) and had the following properties:
When starting the application outside the fiori launchpad (subaccount --> HTML5 Applications), the web service is mapped properly and the request is send successfully.
When starting the application embedded in the fiori launchpad, the web service is NOT mapped properly and the request failed.
xs-app.json:
{
"routes": [{
"source": "^/file-upload",
"target": "/{web-service-upload-subpath}",
"destination": "test-dest",
"authenticationType": "basic"
}
],
...
}
sending test request via fetch api:
_sendTestRequest: function () {
fetch("/file-upload")
.then(...)
.catch(...);
}
When sending this request via application embedded in the fiori launchpad, the request failed (403 Forbidden).
The request URL is:
https://{LAUNCHPAD_ID}.hana.ondemand.com/file-upload
When modify the URL via debugger, the following request is send successfully
https://{LAUNCHPAD_ID}.hana.ondemand.com/{APP_ID}/file-upload
This should be the proper URL.
An ugly workaround to solve this problem is to define a v2 ODataModel in the manifest.json based on a data source with the uri "/file-upload". Of course the "/$metadata" request will be failed, because the web service is not a odata service. But the ODataModel instance member "sServiceUrl" holds the request path and can be used.
Now I ask myself if I must define a multi target application destination service via mta.yaml. I had try a lot of mta.yaml configuration, but nothing has worked.
Maybe you can help me.
Thanks!
Request clarification before answering.
Please check the solution I've found for a similar issue: Calling Service using AJAX in Fiori Elements Extension doesn't work in Launchpad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.