Skip to content
Francesco Chicchiriccò edited this page Jul 19, 2013 · 41 revisions

This page shows some basic concepts and examples to work with of ODataJClient, Open Source (Apache License 2.0) library that enables Java applications to deal with OData 3.0 services.

Preconditions

Obtaining ODataJClient

  1. Obtain source code by either
  2. downloading source ZIP archive
  3. or git clone git@github.com:MSOpenTech/ODataJClient.git
  4. Build
$ cd ODataJClient
$ mvn clean install

At this point ODataJClient is installed into your local Maven repository and you can add it as dependency to your own Maven project as

<dependency>
  <groupId>com.msopentech.odatajclient</groupId>
  <artifactId>odatajclient-engine</artifactId>
  <version>M3</version>
</dependency>

Introduction

There are some common basic concepts that need to be introduced before start working with ODataJClient.

URI management

URIs are a key concept in the OData protocol specification, so you should be already aware of the elements below (full reference to URI syntax is also available):

  1. Service Root and Path Prefix
  2. Resource Path
  3. Query Options

Many methods referenced below in the Examples section require an URI parameter; with ODataJClient two options are available for this purpose:

  1. provide an URI value via plain String: URI.create("http://services.odata.org/OData/OData.svc/Products");
  2. feature the provided ODataURIBuilder - see the Examples below for some sample usage.

Request / Response handling

Examples

Clone this wiki locally