Skip to Content
0

Empty OData in odata service url

Feb 21, 2017 at 07:24 AM

98

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Akhilesh Upadhyay Feb 21, 2017 at 08:31 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Karthik S Feb 21, 2017 at 11:44 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Feb 21, 2017 at 12:46 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Jun Wu,

Enabling proxy in eclipse?

Regards,

Karthik S

0
Jun Wu Feb 21, 2017 at 02:58 PM
0

enable proxy for you web app

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

Share
10 |10000 characters needed characters left characters exceeded
Sarah Lottman
Feb 21, 2017 at 05:30 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Prakash Waddar Mar 03, 2017 at 10:56 AM
0

Hi,

add "proxy" to URL

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

Regards

Prakash

Share
10 |10000 characters needed characters left characters exceeded