2016-08-05 88 views
0

我有我的odata,它是從後端的java spring引導應用程序託管的。 我試圖通過創建odata模型從我的SAP UI5應用程序odata url訪問它,我得到以下錯誤。無法訪問sap ui5中的odata

var oModel = new sap.ui.model.odata.ODataModel("'myodataurl'/odata.svc/Users"); 
Error in console: 

OPTIONS "myodataurl"/odata.svc/Users/$metadata 501 (Not Implemented) 

XMLHttpRequest cannot load "myodataurl"/odata.svc/Users/$metadata. Response to 
preflight request doesn't pass access control check: No 'Access-Control-Allow- 
Origin' header is present on the requested resource. Origin 'myurl' is 
therefore not allowed access. The response had HTTP status code 501.request. 

回答

0

您的服務網址可能只是myodataurl/odata.svc。請嘗試。 URL myodataurl/odata.svc/Users是您的實體集用戶的URL。

並刪除myodataurl附近的單個滴答。