cancel
Showing results for 
Search instead for 
Did you mean: 

Empty OData in odata service url

former_member190063
Participant
0 Kudos

Hi,

I was trying to get data from the odata service url. I am able to run the service in browser after logging in and able to see the data in xml format. But when I do the same in controller,its showing empty odata. Please assist me.

var oDataModel = new sap.ui.model.odata.ODataModel("http://XXXX:12345/sap/opu/odata/SAP/ZJOB_MONITOR_SRV/EtStatusSet",true,"xxxxx", "YYYY");

I have passed the log on paramaters. Still I am unable to read the data. Please find the screen shot.

Thanks and regards,

Karthik S

Accepted Solutions (0)

Answers (6)

Answers (6)

0 Kudos

Hi,

add "proxy" to URL

proxy/http/server:2242/sap/opu/odata/SAP/ZJOB_MONITOR_SRV/

Regards

Prakash

Former Member
0 Kudos

Disable your chrome web security. Properties on Chrome->Shortcut Tab->Target->type --disable-web-security

Eg: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security

After doing this, close all Chrome browsers, relaunch, and it will work.

junwu
Active Contributor
0 Kudos

enable proxy for you web app

if you don't know, just deploy the app to server to run.

junwu
Active Contributor
0 Kudos

if you are running it in eclipse, you have to enable proxy

former_member190063
Participant
0 Kudos

Hi Jun Wu,

Enabling proxy in eclipse?

Regards,

Karthik S

former_member190063
Participant
0 Kudos

Hi Akhilesh,

I am geting below error in console.

XMLHttpRequest cannot load http://server:2242/sap/opu/odata/SAP/ZJOB_MONITOR_SRV/$metadata. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:64412' is therefore not allowed access. The response had HTTP status code 401.

Regards,

Karthik S

former_member227918
Active Contributor
0 Kudos

check if any errors in network tab of browser debugger tool(f12) and share those details too.