简体   繁体   English

ODataMetadata 元数据初始加载失败

[英]ODataMetadata initial loading of metadata failed

I'm trying to read an oData but I'm getting this error and I don't understand why:我正在尝试读取 oData,但出现此错误,我不明白为什么:

在此处输入图片说明

The function which I invoke is the below:我调用的函数如下:

在此处输入图片说明

The error Assertion fails: No metadata loaded!错误Assertion fails: No metadata loaded! is because of first line of function.是因为第一行功能。 As shown in the image below, metadata are retrieved and the status of request is 200:如下图所示,检索到元数据,请求状态为200:

在此处输入图片说明

EDIT Since sap.ui.model.odata.ODataModel is deprecated, I've replaced it with sap.ui.model.odata.v2.ODataModel("/catalog/");编辑由于sap.ui.model.odata.ODataModel已弃用,我已将其替换为sap.ui.model.odata.v2.ODataModel("/catalog/"); . . Now there are these two errors:现在有这两个错误: 在此处输入图片说明

As suggest into the comments, the problem is the oData version.正如评论中所建议的,问题是 oData 版本。 I've fixed the issue using sap.ui.model.odata.v4.ODataModel .我已经使用sap.ui.model.odata.v4.ODataModel解决了这个问题。 In the fourth version of oData the right way to perform crud requests is by using bindings .在 oData 的第四个版本中,执行crud请求的正确方法是使用bindings I've found this tutorial very useful in order to understand how they work.我发现本教程对于了解它们的工作原理非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM