Search code examples
sapui5sap-cloud-platformsap-web-ide

Unable to consume OData in my SAPUI5 app - initial loading of metadata failed


I am facing an issue while trying to consume OData and binding (aggregation binding) it with list item in my demo app.

The webpage is showing "No Data".. I referred other threads, but not similar to my issue. Even posted the thread in SAP QA forum.. no help.

ODATA SERVICE METADATA:

https://sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/$metadata

The destination ES5 has been configured in the backend (SAP HANA CLOUD PLATFORM COCKPIT) also. Tried with no authentication and basic authentication. Still no data is displayed.

Connection testing was successful with message "Connection to "ES5" established. Response returned: 307: Temporary Redirect"Destination configuration in SAP Cloud platform cockpit

Error:

[ODataMetadata] initial loading of metadata failed

Error: HTTP request failed

Code:

VIEW:

<IconTabFilter text="Data Binding" key="db">
  <content>
     <List headerText="Products" items="{/ProductSet}">
        <items>
           <ObjectListItem title="{Name}" number="{Price}" intro="{ProductID}"/>
        </items>
     </List>
   </content>
 </IconTabFilter>

Manifest.json:

"sap.app": {
 ......
  "dataSources": {
    "ES5": {
       "uri": "/destinations/ES5/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/",
       "type": "OData",
       "settings": {
          "odataVersion": "2.0"
        }
     }
   }
},
....
"sap.ui5": {
  "models": {
    .......other models
    "" : {
      "dataSource": "ES5"
    }
  }
}

Neoapp.json

{
   "path": "/destinations/ES5",
   "target": {
      "type": "destination",
      "name": "ES5"
    },
    "description": "ES5 Demo Service"
}

Solution

  • The issue with my OData consumption was the creation of ES5 destination in Cloud Foundry Trial. If the app should be developed in SAP Web IDE which is available only in the Neo environment, we have to create the Neo Trial account from the SAP Cloud Platform Cockpit and create the same ES5 destination there. Now I am able to consume the products list in the OData.

    Screenshot of a landing page of the SCP cockpit From: https://answers.sap.com/questions/13075637/please-help-no-data-is-showing-in-webpage-es5-dest.html