cancel
Showing results for 
Search instead for 
Did you mean: 

How to Consuming Apache Olingo OData Services in SAPUI5?

Jayakrishnan
Active Participant
0 Kudos

Hi All,

I need to consume the OData service created in using Apache olingo in java. I deployed that in tomcat and able to view the entity set and metadata info on the browser. Now i need to consume that in my sapui5 app. below i shared the content .

My Project Structure:

My UI5 app web app folder and index.html navigation link:

My working service url in my browser:

My SAPUI5 master list app screen :

My Master.view.xml code where i mention the list items(Products entity set):

Thank you,

Regards,

JK

Accepted Solutions (0)

Answers (2)

Answers (2)

jamie_cawley
Advisor
Advisor
0 Kudos

Hello Jayakrishnan

Very interesting post!

It looks like a Maven-style Web application with SAPUI5 as UI framework. The folder structure of the UI5 application is like the project template from the HANA cloud with manifest.json and Component.js rather than the SAPUI5 project template from Eclipse. Nicely done!

Q1: May I ask where you deploy it? Does it run in Tomcat?

Q2: What is your database, and related to that, what is the role of Olingo? I suspect the database is not HANA. So you cannot simply add an xsodata file. I guess you have a non-OData database, maybe an SQL database, and you are using Olingo to accomplish the equivalent of xsodata. Is this correct?

Best regards

0 Kudos

Hi Jayakrishnan,

you first need to define the odata model in the mainifest.json as Jamie mentioned. Beside that, regarding the Cross-Origin Resource Sharing (CORS) issue, you have to refer your odata source through the ui5 proxy. In your case, the url in the mainifest.json would be:

"uri":"proxy/http/localhost:8080/DemoService/DemoService.svc"

Hope it helps you.