在ODATA中获得了元数据.接下来是什么? [英] Got metadata in ODATA. what next?

查看:94
本文介绍了在ODATA中获得了元数据.接下来是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图从我不太了解的服务中获取数据.

I am trying to fetch data from a service that i donot know much about.

所以我得到了它的网址 http://ABC.com/ABC.svc

So i got its url like http://ABC.com/ABC.svc

所以我想将元数据作为 http://ABC.com/ABC.svc/ $ metadata

so i thouhgt to get metadata as http://ABC.com/ABC.svc/$metadata

它给了我

<EntityType Name="E1">
- <Key>
<PropertyRef Name="E1k1" /> 
</Key>
< Property Name="E2" Type="Edm.String" Nullable="true"
 m:FC_TargetPath="SyndicationTitle" ..>


<ComplexType Name="OptionV1">
<Property Name="Value" Type="Edm.Int32" Nullable="true" /> 

... and a lot more.

我如何找出ABC.svc/???旁边的内容?

How do i find out what should come next to ABC.svc/???

我想编写查询以访问数据. smebody可以指出下一步该怎么做吗? 并且有关从元数据生成查询的任何学习资源都将非常有用.

I want to write queries to access data. Can smebody point me to what should be my next steps? and any learning resource on this query generation from metadata would be hlpful.

谢谢

推荐答案

LinqPad 为OData服务入门(假设您对LINQ有所了解).如果您主要是主要从.NET使用此应用程序,则建议从此应用程序开始.您将其指向$ metadata端点,它会生成代理类,使您可以像在普通旧的.NET应用程序中一样使用OData服务.在结果日志"选项卡上,它将输出用于查询OData服务的URL,然后您可以在提琴手. (有关如何使用OData + Fiddler的更多信息,请参见此博客文章.)

LinqPad provides a very simple means for getting started with OData services (assuming some familiarity with LINQ). If you will primarily be primarily consuming this application from .NET, I'd recommend starting with this application. You point it to the $metadata endpoint and it generates proxy classes which allow you to work with the OData service much like you would in a plain-old-.NET-app. On the Results Log tab, it will output the URL used to query the OData service, which you can then pick up and tweak in Fiddler. (For more about how to use OData + Fiddler, see this blog post.)

如果主要使用JavaScript的OData服务,则可能需要先了解 URI约定,或者使用 data.js .

If you'll primarily be using the OData service from JavaScript, you might want to start by understanding the URI conventions better or by playing around with data.js.

这篇关于在ODATA中获得了元数据.接下来是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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