我是WEBIDE的新手,我正在尝试使用northwind odata服务,但到目前为止我一直没有成功。请看我的密码和帮助。
在目的地的连接测试也是成功的。但我还是会犯错误:
/V3/Northwin.svc/$元数据“,statusCode: 404,statusText:”Northwind“,headers: Array(0),body:”您正在寻找的资源已被删除,…它的名称更改了,或者暂时不可用。“}responseText:”您正在寻找的资源已被删除,如果其名称更改,或暂时不可用。 statusCode:404 statusText:"Not“proto:Object

有什么建议吗,我可能做错了什么?
:
{
"path": "/destinations/northwind",
"target": {
"type": "destination",
"name": "northwind"
},
"description": "Northwind OData Service"
}manifest.json:
"sap.app": {
"id": "Mod3Act3",
"type": "application",
"i18n": "i18n/i18n.properties",
"title": "{{appTitle}}",
"description": "{{appDescription}}",
"applicationVersion": {
"version": "1.0.0"
},
"dataSources": {
"northwind": {
"uri": "/V3/Northwind/Northwind.svc/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
}
},
"sap.ui5": {
"rootView": {
"viewName": "Mod3Act3.view.Main",
"type": "XML"
},
"dependencies": {
"minUI5Version": "1.30.0",
"libs": {
"sap.ui.core": {},
"sap.m": {},
"sap.ui.layout": {},
"sap.ushell": {},
"sap.collaboration": {},
"sap.ui.comp": {},
"sap.uxap": {}
}
},
"contentDensities": {
"compact": true,
"cozy": true
},
"models": {
"": {
"dataSource": "northwind"
}
},
"resources": {
"css": [{
"uri": "css/style.css"
}]
}
}控制器
var url = "/V3/Northwind/Northwind.svc";
var oModel1 = new sap.ui.model.odata.ODataModel(url, true);
sap.ui.getCore().setModel(oModel1, "categoryList");发布于 2018-01-09 09:17:15
问题在于manifest.json。
"dataSources": {
"northwind": {
"uri": "/destinations/northwind/V3/Northwind/Northwind.svc/",
"type": "OData",
"settings": {"odataVersion": "2.0" }
}
}这起作用了
发布于 2018-01-09 08:31:25
请尝试使用示例从sapui5中走过:
manifest.json
{
"_version": "1.8.0",
"sap.app": {
...
"ach": "CA-UI5-DOC",
"dataSources": {
"invoiceRemote": {
"uri": "https://services.odata.org/V2/Northwind/Northwind.svc/",
"type": "OData",
"settings": {
"odataVersion": "2.0"
}
}
}
},
"sap.ui": {
...
},
"sap.ui5": {
...
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "sap.ui.demo.walkthrough.i18n.i18n"
}
},
"invoice": {
"dataSource": "invoiceRemote"
}
}
}
}控制器
...
var oModel = this.getView().getModel("invoice");
...请注意由于https连接和链接演练示例中提到的相同来源策略而接受证书。
https://stackoverflow.com/questions/48163246
复制相似问题