Use JAX-B or Castor for document-style encoding?

admin 7

For my Open Source project, I want to expose a stateless session bean (SLSB) as web service using JBoss 3.2 and Axis 1.1. Now I’m wondering whether to use JAX-B or Castor for my document-style encoding, since the information I found in “Create Web services using Apache Axis and Castor” on IBM’s developerWorks may be a bit outdated already. Any thoughts on this?

By the way, this document clearly describes Axis 1.1 and JBoss 3.2.x configuration, exactly for this purpose (exposing a SLSB as WS using Axis and JBoss).

7 thoughts on “Use JAX-B or Castor for document-style encoding?

  1. Pingback: Tubas
  2. xmlbeans is a superb API as long as you have a schema not a DTD for your document, which obviously is your case, too. Unfortunately, I cannot comment upon its integration with Axis, but I think you’ll probably have the same namespace ‘issues’ as the one related to Castor, mentioned by Dan.

  3. No problems with xmlbeans, I think (I haven’t got experience). But if there are any arguments in favour of it (such as ease of use :-), I’ll surely consider it an option.

  4. From my experience with Castor and Axis, I would say that it works pretty well. IBM’s excellent article
    provides a solid roadmap for implementing DOC/Literal. My process for managing changes in the interface
    (new fields exposed in the service) is pretty simple. I make a change in the schema, run an ant target
    to generate binding classes, merge generated classes with my code base, recompile and deploy. Issues
    to watch out for include:

    – namespaces in the schema: I found that the xml returned from the service contained namespace prefixes
    for every attribute and element! I ended up removing namespace settings from within the generated classes.

    – Axis bug fixes: There were a few classes in Axis that had bugs relating to Castor. I grabbed the fixes from
    cvs because they weren’t included in the standard Axis distribution (can’t remember what classes were fixed).

    I’m sure there are better ways to implement now. I haven’t played with JAX-B so I don’t know how easy it is.

    Good Luck!

Comments are closed.

Next Post

New open source databases: Cloudscape (Apache Derby) and Ingres

Facebook0TwitterLinkedinRecently, IBM announced the open-sourcing of their Cloudscape database. a lightweight, Java-based relational database with a footprint of just 2MB. It’s significantly less resource-intensive than enterprise databases like IBM’s DB2. Its target use is to underpin small Web sites, point-of-sale systems and departmental-level or small-business applications. As was read in […]