/scripts/ahub.form.attachments.js
0

error connection to odata service ODATA SAPUI5

Jan 27, 2017 at 09:29 AM

60

avatar image

hello everyone ,

please i have an error when running my sapui5 application and it can connect to my odata services :

this is below the code that i put to my component.js

var domainString = "document.domain";

domainstring = "*.com";

'Access-Control-Allow-Origin: http://localhost:*';

'Access-Control-Allow-Credentials: true'; 'Access-Control-Allow-Headers: X-KEY';

var oModel = new sap.ui.model.json.JSONModel("http://servnsissap09.wynsys.local:8000/sap/opu/odata/sap/ZHS_SANOFI_WM_SRV/WINNOV_VEKPSet?$format=json",false,"[username]","[password]");

oView.setModel(oModel);

and this is the error that i have :

error-json.png (18.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

janu m Jan 27, 2017 at 09:37 AM
0

Hi salma,

go through below link once,

https://archive.sap.com/discussions/thread/3380807

Thanks

Janu

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

hi Janu M ,

Thank you for your relply but i already see this post and tried this code and still the same problem :(

0
Jawad Margieh
Jan 29, 2017 at 07:37 AM
0

If you're doing an XMLHttpRequest to a different domain than your page is on. the browser will not allow request of different origin.

If you're using the same origin and still face this error:

try using this chrome extension:
https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi

Btw did you try running your app in Firefox ?

Best

Jawad

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content