Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper tool for simple XML interfaces [closed]

I need to expose some services of the web application to remote clients via XML interfaces over http. A number of provided services is limited (3-7), both request and response should be kept simple and do not require any special data types or cross-entity relations.

My goal is to keep the code clean and clear and have robust and performant application. I would really appreciate your advices regarding the proper XML binding\processing tool to be used for that task.

UPD: My bad, haven't mentioned that restlet is required for implementation, however, as far as I am concerned, it does not impose any restrictions on the xml tool to be used.

Thanks in advance.

like image 224
n0weak Avatar asked Sep 09 '11 21:09

n0weak


2 Answers

The JAX-RS specification (JSR-311) provides a standard means of creating RESTful services over HTTP. There are several JAX-RS implementations: Jersey, RESTEasy, Wink. JAXB (JSR-222) is the standard binding layer (objects to/from XML) for JAX-RS, and there are several implementations: MOXy, Metro, JaxMe, etc.

These implementations are also come pre-bundled with Java EE application servers (i.e. GlassFish and WebLogic contain Jersey).

Here is an example I put together using Jersey & MOXy in GlassFish:

  • Part 1 - The Database
  • Part 2 - Mapping the Database to JPA Entities
  • Part 3 - Mapping JPA entities to XML (using JAXB)
  • Part 4 - The RESTful Service
  • Part 5 - The Client
like image 70
bdoughan Avatar answered Sep 21 '22 13:09

bdoughan


We've done some work recently using Apache CXF, and found its JAX-RS support to be simple and allow us to write very DRY friendly code.

There is a reasonable amount of flexibility, e.g. several different data binding layers to choose from.

like image 35
Brian Smith Avatar answered Sep 19 '22 13:09

Brian Smith