Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

running generated odata in the app

I am using this tutorial to complete an end 2 end implementation...

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b01089ed-dead-3110-f28e-caa12aeb5e27?QuickLink=index&…

but after I created a ui5 project and generated the Odata service I try to call it insidethe app but it doesn’t work. (run it on hana studio server (tomcat or another).

When I call the odata in the browser like this

http://example.com:8001/sap/opu/odata/sap/ZE2E_CUST_INFO_KY_SRV/?$format=xml

It works. (after logging in)
But using the link like that in the application is not working (authorization error in console).

When I use the method that is documented:

var configData = {

          
resourceBundle :
"i18n/messageBundle.properties",          
serviceConfig : {
                  
name:
"ZE2E_CUST_INFO_KY_SRV", 
serviceUrl:
"/sap/opu/odata/sap/ZE2E_CUST_INFO_KY_SRV/"           
}};


var sServiceUrl =
configData.serviceConfig.serviceUrl;


var oModel = new
sap.ui.model.odata.ODataModel(sServiceUrl, {json:
true,loadMetadataAsync: true});

sap.ui.getCore().setModel(oModel);


You will get the following error in the console:

GET http://localhost:8672/sap/opu/odata/sap/ZE2E_CUST_INFO_KY_SRV/$metadata 404 (Not Found)

The only way I can get it to work is with the local web ide but that has an outdated ui5library…

So what do i need to do to get it working ?

Maybe some ideas...

- Do I need to deploy it first to the abap server and run it from there to make it work instead of locally ?

- Is there a way to update the local web ide to the latest ide (like the one in the cloud) ?

Tags:
replied

Hello Shreyas,

at first sight, it appears to me that you want to test your service locally, but your service URL refers to your application server.

Try adding the IP Address and Port of your application server to the service URL.

Or try deploying your application to the abap server and try it out there.

Regards,

Dominik

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question