简体   繁体   English

如何从Java与OData交互?

[英]How do I interact with OData from Java?

OData is Microsoft's repackaging of its Astoria (now WCF Data Services) RESTful query/update protocol. OData是微软重新打包其Astoria(现在的WCF数据服务)RESTful查询/更新协议。 If I want to use Java to create an OData compatible data source, how do I do that? 如果我想使用Java创建兼容OData的数据源,我该怎么做? Similarly, if I want to consume an OData data source from Java, how do I do that? 同样,如果我想从Java使用OData数据源,我该怎么做?

http://www.odata.org/ http://www.odata.org/

Partial answer below. 部分答案如下。

The OData website suggests that Restlet supports OData. OData网站建议Restlet支持OData。 Restlet's API documentation mentions the org.restlet.ext.odata package. Restlet的API文档提到了org.restlet.ext.odata包。

www.restlet.org/ www.restlet.org/

www.restlet.org/documentation/snapshot/jee/ext/org/restlet/ext/odata/package-summary.html 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? 有没有关于这种整合的博客文章?

还有odata4j

There is a olingo library in java which can be used for RESTful communication with Odata protocol. java中有一个olingo库,可用于与Odata协议进行RESTful通信。

you can refer the following link for the reference: https://olingo.apache.org/doc/odata4/index.html 您可以参考以下链接作为参考: https//olingo.apache.org/doc/odata4/index.html

You can find the source code for sample project too from the above link. 您也可以从上面的链接中找到示例项目的源代码。

Any Java library that can consume an Atom feed will be able to read an OData source. 任何可以使用Atom提要的Java库都可以读取OData源。 Any Java library that can perform the Atom pub protocol will be able to update an OData service. 任何可以执行Atom pub协议的Java库都可以更新OData服务。

What you will not be able to do out of the box is perform queries and access the EDM properties. 您无法开箱即用的是执行查询并访问EDM属性。 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. 如果您能够将客户端与服务耦合起来,那么任何XML解析器都可以非常轻松地将数据从OData条目中提取出来。

There is a Microsoft blog post with various pointers to OData interoperability resources: 有一篇Microsoft博客文章,其中包含指向OData互操作性资源的各种指示:

OData interoperability with .NET, Java, PHP, iPhone and more OData与.NET,Java,PHP,iPhone等的互操作性

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

相关问题 如何有效地与Scala中的Java流进行交互? - How do I effectively interact with Java streams from Scala? 如何从我的 Java 应用程序与控制台应用程序交互? - How do I interact with a console application from my Java app? 如何使用Java与MySQL交互? - How do I use interact with MySQL using Java? 如何与 Java 中的 RESTful 服务中的阻塞队列交互? - How do I interact with a blocking queue in a RESTful service in Java? 如何从Python与Java交互 - How to interact with Java from Python 我应该如何最好地与这个互动 <li> 从Selenium Java Webdriver - How best should I interact with a this <li> from Selenium Java Webdriver 如何在ActivityInstrumentationTestCase2中与UI组件进行交互? - How do I interact with UI Components from within ActivityInstrumentationTestCase2? 如何在其他 Java 程序可以与之交互的服务器上运行 .java 文件? - How do I run a .java file on a server that other java programs can interact with? 如何制作Java .exe以允许用户像在Eclipse命令窗口中一样进行交互? - How do I make a java .exe to allow user to interact as I would in the eclipse command window? 如何使用Java与JavaScript网站互动 - How can I interact with javascript website with java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM