on 07-13-2022 9:09 AM
Dear all,
in our current app we use an OData v2 and v4 model which are both working fine locally with the v2 proxy and the suffix "v2". When deploying this to the portal service in your space on the SAP BTP the OData v2 metadata is not loaded and throws an Internal Server Error - 500.
Does anyone know how to solve this? (xs-app.json and manifest are attached)
Does the portal service only work with OData v4? trying several sources as routes for odata v2 inside the xs-app.json was not successfull yet.
app specific manifest:
"dataSources": {
"mainService": {
"uri": "service/",
"type": "OData",
"settings": {
"odataVersion": "4.0"
}
},
"mainService-v2": {
"uri": "v2/service/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
},
"models": {
"": {
"dataSource": "mainService",
"preload": true,
"settings": {
"synchronizationMode": "None",
"operationMode": "Server",
"autoExpandSelect": true,
"earlyRequests": true
}
},
"v2": {
"dataSource": "mainService-v2",
"preload": true,
"settings": {
"defaultBindingMode": "TwoWay"
}
}
},<br>
app specific xs-app.json:
{
"welcomeFile": "/index.html",
"authenticationMethod": "route",
"logout": {
"logoutEndpoint": "/do/logout"
},
"routes": [
{
"authenticationType": "none",
"csrfProtection": false,
"source": "^/service/",
"destination": "my-service"
},
{
"authenticationType": "none",
"csrfProtection": false,
"source": "^/v2/service/",
"destination": "my-service"
},
{
"authenticationType": "none",
"csrfProtection": false,
"source": "^/v2/service/(.*)$",
"destination": "my-service"
},
{
"source": "^(.*)$",
"target": "$1",
"service": "html5-apps-repo-rt",
"authenticationType": "xsuaa"
}
]
}<br>
Hi,
I had a similar problem a while ago. Does your cap service has a binding to a destination service defined in your mta.yaml? In my case this solved the metadata loading error on the frontend.
modules:
- name: myApp-srv
type: nodejs
path: gen/srv
requires:
- name: myApp-destination
resources:
- name: myApp-destination
type: org.cloudfoundry.managed-service
parameters:
service-plan: lite
service: destination
BR
Nico
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Max,
yup, had the same when using v2 odata service. OData v4 was working fine.
Here's my xs-app.json:
{
"source": "/user-api/currentUser$",
"target": "/currentUser",
"service": "sap-approuter-userapi"
},
{
"source": "^/v2/mypath/(.*)$",
"target": "/v2/mypath/$1",
"destination": "myapp-srv",
"authenticationType": "xsuaa",
"csrfProtection": true
},
{
"source": "^(.*)$",
"target": "$1",
"service": "html5-apps-repo-rt",
"authenticationType": "xsuaa"
}
Are you using a standalone approuter or the managed approuter?
BR
Nico
User | Count |
---|---|
69 | |
8 | |
8 | |
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.