My app's controllers mostly call one dataSource with no issues.
One of them, however uses three seperate datasources, and sometime returns 403 Forbidden errors when accessing them.
"dataSources": {
"ZSV_SURVEY_SRV": {
"uri": "/SAPUI5-ABAP-SFI/sap/opu/odata/sap/ZSV_SURVEY_SR/",
"type": "OData",
"settings": {
"odataVersion": "2.0",
"localUri": "localService/metadata.xml"
}
},
"ZRUI_COMMON_SRV": {
"uri": "/SAPUI5-ABAP-SFI/sap/opu/odata/sap/ZRUI_COMMON_SRV/",
"type": "OData",
"settings": {
"odataVersion": "2.0",
"localUri": "localService/ZRUI_COMMON_SRV/metadata.xml"
}
},
"ZTC_SHOP_TRADING_CALENDAR_SRV": {
"uri": "/SAPUI5-ABAP-SFI/sap/opu/odata/sap/ZTC_SHOP_TRADING_CALENDAR_SRV/",
"type": "OData",
"settings": {
"odataVersion": "2.0",
"localUri": "localService/ZTC_SHOP_TRADING_CALENDAR_SRV/metadata.xml"
}
}
}
Would it be better to incorporate the methods all into one dataSource (e.g. ZSV_SURVEY_SRV
? Or should three separate dataSources be fine and present no problems?
If three dataSources are fine, why do I sometime get the 403
error?
Is there a performance advantage either way?
Apart from the 403 Forbidden error you are facing, having everything in the same service has its advantages:
Design perspective
Performance perspective
There are definitely more reason for using just one service. As a general rule a Fiori app uses only on service. Also, this service is only used by the Fiori app mentioned. This makes maintenance way easier.
Of course there are exceptions for that, specially when it comes to annotation services.
If you really need three different services for a good reason consider as well creating a 4th one combining all three. In SEGW you can combine other services inside a project by right-clicking in Data Model folder and using Include >> OData Service (GW) option
But in any case make use of different entity sets in the same service. It's worth it.