如何从 Java 与 OData 交互?
OData 是 Microsoft 对其 Astoria(现在的 WCF 数据服务)RESTful 查询/更新协议的重新包装。如果我想使用 Java 创建 OData 兼容的数据源,我该怎么做?同样,如果我想从 Java 使用 OData 数据源,我该怎么做?
以下部分答案。
OData网站建议Restlet支持OData。 Restlet 的 API 文档提到了 org.restlet.ext.odata 包。
www.restlet.org/
www.restlet.org/documentation/snapshot/jee/ext/org/restlet/ext/odata/package-summary.html
这是唯一的答案吗?有关于进行此集成的博客文章吗?
OData is Microsoft's repackaging of its Astoria (now WCF Data Services) RESTful query/update protocol. If I want to use Java to create an OData compatible data source, how do I do that? Similarly, if I want to consume an OData data source from Java, how do I do that?
Partial answer below.
The OData website suggests that Restlet supports OData. Restlet's API documentation mentions the org.restlet.ext.odata package.
www.restlet.org/
www.restlet.org/documentation/snapshot/jee/ext/org/restlet/ext/odata/package-summary.html
Is this the only answer? Are there blog posts on doing this integration?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
还有 odata4j。
There is also odata4j.
java中有一个olingo库,可用于与Odata协议进行RESTful通信。
您可以参考以下链接:
https://olingo.apache.org/doc/odata4/index.html
您也可以从上面的链接找到示例项目的源代码。
There is a olingo library in java which can be used for RESTful communication with Odata protocol.
you can refer the following link for the reference:
https://olingo.apache.org/doc/odata4/index.html
You can find the source code for sample project too from the above link.
任何可以使用 Atom feed 的 Java 库都能够读取 OData 源。任何可以执行 Atom pub 协议的 Java 库都能够更新 OData 服务。
您无法开箱即用地执行查询和访问 EDM 属性。根据您需要的松散耦合程度,这要么很容易做到,要么非常困难。如果您能够将客户端耦合到服务,那么使用任何 XML 解析器从 OData 条目中提取数据应该非常容易。
Any Java library that can consume an Atom feed will be able to read an OData source. Any Java library that can perform the Atom pub protocol will be able to update an OData service.
What you will not be able to do out of the box is perform queries and access the EDM properties. Depending on how loosely coupled you need to be this will either be really easy to do or damn difficult. If you can survive coupling your client to the service then it should be pretty easy with any XML parser to pull the data out of the OData entry.
有一篇 Microsoft 博客文章,其中包含各种指向 OData 互操作性资源的指针:
There is a Microsoft blog post with various pointers to OData interoperability resources:
请参阅:http:// blog.noelios.com/2010/03/15/restlet-supports-odata-the-open-data-protocol/ 以及:http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/287 -restlet/288-restlet.html
这里还有越来越多的关于 OData 的信息: http://odata.org/developers/odata-sdk
希望这对
亚历克斯有帮助
See this: http://blog.noelios.com/2010/03/15/restlet-supports-odata-the-open-data-protocol/ and this: http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/287-restlet/288-restlet.html
Also there is a growing list of information on OData here: http://odata.org/developers/odata-sdk
hope this helps
Alex
这里有更多信息: http://wiki .restlet.org/docs_2.0/13-restlet/28-restlet/287-restlet.html
There's more info here: http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/287-restlet.html