This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Services and the fly likes Creating Object from XML file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Creating Object from XML file" Watch "Creating Object from XML file" New topic

Creating Object from XML file

Purvesh Vora
Ranch Hand

Joined: Dec 10, 2003
Posts: 47

Can you please tell me which tool( or probably which of the API) could be used for creating java object from an input XML file.

I heard that castor is the one that supports this. What jaxb does? if both of them are supporting the same thing then which one is better?

Regards,<br />Purvesh<br />SCJP, SCBCD, IBM Exam #486
Peer Reynders

Joined: Aug 19, 2005
Posts: 2932
JAXB 2.0 would be my choice as it is part of Java 6 SE anyway.
Paulo Salgado
Ranch Hand

Joined: Jan 18, 2002
Posts: 98
I second that, specially if you're thinking about developing Web Services with Java, as data binding has been removed from the new JAX-RPC (JAX-WS). J2EE vendors will need to provide or use a JAXB implementation to be compliant.

As a feedback we've been using JAXB 1.1 for over a year without problems. Our XML Schemas are somewhat complex and JAXB handles them nicely, something that WSDL2Java from both Apache Axis and IBM Websphere didn't.

Purvesh Vora
Ranch Hand

Joined: Dec 10, 2003
Posts: 47
Thank you Peer & Paulo.
gopinathang nathan
Ranch Hand

Joined: Oct 28, 2006
Posts: 41
For weblogic 'autotype' -
I agree. Here's the link:
subject: Creating Object from XML file
It's not a secret anymore!