欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 汽车 > 维修 > Fiori学习专题二十五:Remote OData Service

Fiori学习专题二十五:Remote OData Service

2025/5/2 17:21:24 来源:https://blog.csdn.net/weixin_43929815/article/details/147633803  浏览:    关键词:Fiori学习专题二十五:Remote OData Service

之前我们都是使用本地JSON来显示发票清单。这节课我们将调用一个UI5公共的OData Service
1.由于本地开发访问OData服务https://services.odata.org/V2/Northwind/Northwind.svc/会产生跨域问题,所以这里我们需要使用代理
新建一个终端:执行:npm i -D ui5-middleware-simpleproxy 将此包作为新的开发依赖项安装在package.json中
2.在ui5.yaml文件中加入

specVersion: '3.0'
metadata:name: ui5.walkthrough
type: application
framework:name: OpenUI5version: "1.134.0"libraries:- name: sap.m- name: sap.ui.core- name: themelib_sap_horizon
server:customMiddleware:- name: ui5-middleware-simpleproxyafterMiddleware: compressionmountPath: /V2configuration:baseUri: "https://services.odata.org"

3.manifest.json调整

	{"_version": "1.65.0","sap.app": {"id": "ui5.walkthrough","i18n": "i18n/i18n.properties","title": "{{appTitle}}","description": "{{appDescription}}","type": "application","applicationVersion": {"version": "1.0.0"}, "dataSources": {"invoiceRemote": {"uri": "V2/Northwind/Northwind.svc/","type": "OData","settings": {"odataVersion": "2.0"}}}},"sap.ui": {"technology": "UI5","deviceTypes": {"desktop": true,"tablet": true,"phone": true}},"sap.ui5": {"dependencies": {"minUI5Version": "1.108.0","libs": {"sap.ui.core": {},"sap.m": {}}},"models": {"i18n": {"type": "sap.ui.model.resource.ResourceModel","settings": {"bundleName": "ui5.walkthrough.i18n.i18n","supportedLocales": [""],"fallbackLocale": ""}},"invoice": {"dataSource": "invoiceRemote"}},"rootView": {"viewName": "ui5.walkthrough.view.App","type": "XML","id": "app"},"resources": {"css": [{"uri": "css/style.css"}]}}}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词