每个 OData 服务都会提供元数据文件吗? [英] Every OData Service will provoide metadata document?

查看:58
本文介绍了每个 OData 服务都会提供元数据文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 OData 服务中的元数据文件有点困惑.正如 odata-v4.0-part1-protocol 文档中提到的,有两个定义良好的资源来描述其数据模型,一个服务文档和一个元数据文档.

I'm a little bit confused that metadata doucment in OData Service. As odata-v4.0-part1-protocol doc mentioned, there are two well-defined resources that describe its data model, a service document and a metadata document.

我想知道这是否意味着这两种资源都必须在 OData 服务的开发过程中实现,还是开发人员只需根据自己的选择实现其中一种?

I want to know if that means both of these two resources must be implemented during development of OData Services, or developers just only need to implement one of them by their own choices?

我非常感谢任何人的帮助.谢谢

I do appreciate anyone's help. Thanks

推荐答案

不一定.根据OData V4 规范:

  • 对于最低一致性级别可以根据 [OData-CSDL] 在 $metadata 发布元数据"
  • 对于中间一致性级别应该根据 [OData-CSDL] 在 $metadata 上发布元数据"
  • 对于高级一致性级别,必须根据 [OData-CSDL] 在 $metadata 上发布元数据".

换句话说,这意味着元数据对于 OData V4 服务不是必须的,但服务文档是必须的.如果你对OData有更深入的了解,OData库有两种——服务端和客户端,OData的元数据文档是为了让高级客户端更了解服务(模型、类型等).因此,是否拥有元数据文档实际上取决于您是否希望您的服务与尽可能多的客户进行交流.

In other word, this means metadata is NOT a must for OData V4 service but service document is a MUST. If you have a deeper understand of OData, there are two kinds of OData libraries -- server and client, the metadata document of OData is for advanced client to know more about the service(models, types and so on). So having metdata document or not actually depends on whether you want your service to be talked to as much clients as possible.

这篇关于每个 OData 服务都会提供元数据文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆