cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid metadata document & Initial loading of metadata failed

federicosap
Newcomer

Good Morning boys.

my SAPUI5 application tells me the following:

but the data source is configured correctly

Manifest.json

<code>{
    "_version": "1.8.0",
    "sap.app": {
        "id": "com.mycompany.z_fspm_car_valuation",
        "type": "application",
        "i18n": "i18n/i18n.properties",
        "applicationVersion": {
            "version": "1.0.0"
        },
        "title": "{{appTitle}}",
        "description": "{{appDescription}}",
        "sourceTemplate": {
            "id": "servicecatalog.connectivityComponentForManifest",
            "version": "0.0.0"
        },
        "dataSources": {
            "ZGW_CAR_VALUATION_SRV": {
                "uri": "https://aws-wdq.mycompany.com.ar:51025/sap/opu/odata/sap/ZGW_CAR_VALUATION_SRV/",
                "type": "OData",
                "settings":{
                    "odataVersion": "2.0"
                }
            }
        }
    },
    "sap.ui": {
        "technology": "UI5",
        "icons": {
            "icon": "",
            "favIcon": "",
            "phone": "",
            "phone@2": "",
            "tablet": "",
            "tablet@2": ""
        },
        "deviceTypes": {
            "desktop": true,
            "tablet": true,
            "phone": true
        },
        "supportedThemes": [
            "sap_hcb",
            "sap_belize"
        ]
    },
    "sap.ui5": {
        "rootView": {
            "viewName": "com.mycompany.z_fspm_car_valuation.view.AppView",
            "type": "XML"
        },
        "dependencies": {
            "minUI5Version": "1.30.0",
            "libs": {
                "sap.ui.layout": {},
                "sap.ui.core": {},
                "sap.m": {}
            }
        },
        "contentDensities": {
            "compact": true,
            "cozy": true
        },
        "models": {
            "i18n": {
                "type": "sap.ui.model.resource.ResourceModel",
                "settings": {
                    "bundleName": "com.mycompany.z_fspm_car_valuation.i18n.i18n"
                }
            },
            "": {
                "uri": "https://aws-wdq.mycompany.com.ar:51025/sap/opu/odata/sap/ZGW_CAR_VALUATION_SRV/",
                "type": "sap.ui.model.odata.v2.ODataModel",
                "settings": {
                    "defaultOperationMode": "Server",
                    "defaultBindingMode": "OneWay",
                    "defaultCountMode": "Request",
                    "useBatch": false
                },
                "dataSource": "ZGW_CAR_VALUATION_SRV",
                "preload": true
            }
        },
        "resources": {
            "css": [
                {
                    "uri": "css/style.css"
                }
            ]
        },
        "routing": {
            "config": {
                "routerClass": "sap.m.routing.Router",
                "viewType": "XML",
                "async": true,
                "viewPath": "com.mycompany.z_fspm_car_valuation.view",
                "controlAggregation": "pages",
                "controlId": "idAppControl",
                "clearControlAggregation": false
            },
            "routes": [
                {
                    "name": "main",
                    "pattern": "",
                    "target": [
                        "AppView"
                    ]
                },
                {
                    "name": "detail",
                    "pattern": "detail/{YEAR}/{CODVAL}/",
                    "target": [
                        "VehicleDetail"
                    ]
                }
            ],
            "targets": {
                "AppView": {
                    "viewType": "XML",
                    "transition": "slide",
                    "clearControlAggregation": false,
                    "viewName": "AppView"
                },
                "VehicleDetail": {
                    "viewType": "XML",
                    "transition": "slide",
                    "clearControlAggregation": false,
                    "viewName": "VehicleDetail"
                }
            }
        }
    },
    "sap.platform.abap": {
        "uri": "/sap/bc/ui5_ui5/sap/zfspm_car_val",
        "_version": "1.1.0"
    }
}

All the configuration is perfect, I have already consumed the odata service of "Northwind" ( https://services.odata.org/V2/Northwind/Northwind.svc/ ) in the same way and it works, but the service I am trying to consume does not work.

The service and Postman tell me "200 ok".

Postman says: "Unable to get local issuer certificate"

I am trying to consume the odata service of my company where I work.

Accepted Solutions (1)

Accepted Solutions (1)

leonikussmaul
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Federico,

An OData service would be hosted on the same domain as your UI5 app if it is deployed on the same server as your app. For example, if you have a web application developed using UI5, and you deploy the application and the OData service on the same SAP NetWeaver ABAP server, then they will be hosted on the same domain.

If your OData Service is hosted on the same domain as your Ui5 app, try giving only the relative path in the manifest only:

"ZGW_CAR_VALUATION_SRV":{
"uri": "/sap/opu/odata/sap/ZGW_CAR_VALUATION_SRV/",
...}

However, if the OData service is deployed on a different server, then it will be hosted on a different domain. In such cases, you will want to use SAP BTP destinations to access the OData service from your UI5 app. In your xs-app.json file, you then define a route that points to the destination in your BTP account. The n you can make requests to the destination using a relative URL that matches the route.

xs-app.json

  "routes": [
    {
      "source": "/my-odata-service/(.*)",
      "destination": "my-odata-service-destination"
    }
  ]

This is not needed in Postman as the HTTP request is not subject to the same-origin policy or CORS restrictions. Postman is a standalone app that sends requests directly from your computer to the destination server, so there is no browser involved.

p.s. we're not all boys..

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

that's not correct.

it should be relative url.