views:

788

answers:

5

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?

http://www.odata.org/

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?

+1  A: 

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.

Darrel Miller
+1  A: 

There is a Microsoft blog post with various pointers to OData interoperability resources:

OData interoperability with .NET, Java, PHP, iPhone and more

0xA3
+2  A: 

There is also odata4j.

Fabrice
odata4j provides a server framework to build java data sources as well as clients
John Spurlock