我的manifest.json
文件中的代码:
"dataSources": {
"mainService": {
"uri": "server-url/sap/opu/odata/sap/ZDEMO_ODATA_PRACTICE_SRV",
"type": "OData",
"settings": {
"odataVersion": "2.0",
"localUri": "localService/metadata.xml"
}
}
}
"models": {
"": {
"dataSource": "mainService",
"preload": true
}
}
<mvc:View controllerName="dummyproject.dummyproject.controller.App"
xmlns:mvc="sap.ui.core.mvc"
xmlns="sap.m"
displayBlock="true">
<!-- ... -->
<List items="{/PersonSet}">
<!-- ... -->
</List>
<!-- ... -->
</mvc:View>
连接正在工作,但是我在屏幕上获得了一个空列表和以下错误消息:
[odatametadata]元数据的初始加载失败
我已经看到了错误指南,表明此错误与相同的原始策略有关,但我认为我可以解决它与创建目标有关。
I还在SAP GUI中检查了ODATA服务本身,并与SAP Gateway Client进行了测试,在该客户端起作用而没有任何问题。有人知道如何处理这个错误,或者可能知道我可能做错了什么?
我假设您将BAS / VSCODE用作前端IDE。如果是这样,您可以将
ui5.yaml
用于中间件以避免CORS。例如:
specVersion: '2.4' metadata: name: 'swadhin.demo.northwind.employee.readonly' type: application server: customMiddleware: - name: fiori-tools-proxy afterMiddleware: compression configuration: ignoreCertError: false # If set to true, certificate errors will be ignored. E.g. self-signed certificates will be accepted backend: - path: /V2 url: https://services.odata.org ui5: path: - /resources - /test-resources url: https://ui5.sap.com version: # The UI5 version, for instance, 1.78.1. Empty means latest version - name: fiori-tools-appreload afterMiddleware: compression configuration: port: 35729 path: webapp
在您使用旧的SAP Web IDE的情况下,您可以将
neo-app.json
用于反向Proxy:
{
"welcomeFile": "/webapp/test/flpSandbox.html",
"routes": [
{
"path": "/sap/opu/odata",
"target": {
"type": "destination",
"name": "DESTINATION",
"entryPath": "/sap/opu/odata"
},
"description": "DESTINATION"
}
]
}
path
在
manifest.json
:
"uri": "/sap/opu/odata/sap/ZDEMO_ODATA_PRACTICE_SRV",
从网关的角度来看,您可以使用错误日志和有效载荷跟踪对此问题进行故障排除。但是,当您在Chrome Developer Tools中的“网络”选项卡中看到失败的请求时,这些都非常有用(您没有提及是否这样做)。 错误日志: call/n/iwfnd/error_log在您的网关系统中
在菜单中,选择错误日志 - > GlobalConfig
将日志级别设置为fulpSave改用错误返回错误日志,并检查您的错误是否已记录。如果已记录,请选择它,然后单击“重播到网关客户端”,然后让我们知道方法,URL,请求标题和请求正文(如果有) +错误响应
ther/n/iwfnd/traces the yout GatewaySystems