What API to use

Basically Nuxeo 5 provides 3 flavors of APIs :

  • Rest API : simple http GET/POST
  • Web Service API : JAX-RPC and JAX-WS
  • Java API : available both localy or remotly via EJB3 remoting
These 3 types of APIs provide different advantages.

NB : Alternatively, you may also use the XML-RPC connector.

Rest API

The RestAPI is the most simple API to use. On the client side, you don't require anything else than the possibility to issue HTTP requests. This means that you can use this API from any language.

The current RestAPI provides you with a set of methods to search and extract content from Nuxeo5, but also to create some content.

The RestAPI is very easily plugable, so if you need to do some specific task, you can simply contribute a restlet to the nuxeo server and call it from your client via http.

You can find more information about Restlets and RestAPI here.

Web Service API

WebService API is mainly used by external search engines that need to fetch some data from Nuxeo Server.

For that purpose, Nuxeo exposes JAX-RPC WebServices that allow getting data from the Repository and from the Audit Service. Typically these WebServices will allow you to :

  • browse the repository
  • get all the document meta-data
  • get the security descriptor for one document
  • get the list of document that where modified since a give date
  • resolve a path to a uuid
  • ...
Nuxeo Server also contains a pluggable JAX-WS connector, but it is not used for now.

Java API

Java API is the native Nuxeo API. In fact, almost all the APIs used inside Nuxeo are also available remotly.

On the client side, using Nuxeo API will require you to embed the needed Nuxeo API jars and you may need to embed Nuxeo Runtime.

Using Java API provides you with the most powerfull API : you can access everything. In termes of performances, this is also the best option : no http and xml marshaling is needed.

Since Java remote API uses RMI you may have some troubles going throught firewalls or NAT.

You may find additionnal informations here

APIs comparison

Simplicity of use

In terme of usage simplicity the APIs can be sorted like this :

  1. Rest API
  2. WS-API
  3. Java API

Dependecies requirements

Depending on the API you use you may need some additionnal libs on the client side.

  • 1- Rest API
You basically don't need anything else than http. You can use nuxeo-http-client that provides a restletAPI encapsulation and also provides authentication mechanism.
  • 2- WS-API
You will at least require a JAX-RPC or JAX-WS compliant stack.
  • 3- Java API
Using Java API requires at least the API jars of the services you will use. You may also need to initialize the Nuxeo Runtime.

Speed :

  • 1- Java API
Binary transport over a connected transport protocol.
  • 2- Rest API
Transport is http but the marshaling is reduced to the strict minimum. Since the API is very easily pluggable, you can easily expose very dedicated method that include some business logic on the server side : this will help you to reduce the network round trip.
  • 3- WS-API
Definitly the slowest.

Power

  • 1- Java API
You have acces to all the platform features. You may also directly access the JMS Bus to do some event handling.
  • 2- Rest API
Since the API is very pluggable, you can easily exporty any feature via a Restlet.
  • 3- WS-API
Current API is limited to ReadOnly. Nevertheless, the JAX-WS connector is pluggable, so you can use it to expose the APi you need.

Accessibility

  • 1- Rest API / WS-API
By default http is used for transport
  • 2- Java API
By default RMI over JRMP is used : this is not firewall friendly and not NAT compliant. You may use http transport to overcome these limitations.
Version 9.1 last modified by Thierry Delprat on 24/07/2008 at 13:29

Comments 0

No comments for this document

Attachments 0

No attachments for this document

Creator: Thierry Delprat on 2008/07/24 12:16
© 2008-2010 Nuxeo
1.3.8295