*
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
JavaRanch » Java Forums » Java » Web Services
Bookmark "Creating Object from XML file" Watch "Creating Object from XML file" New topic
Author

Creating Object from XML file

Purvesh Vora
Ranch Hand

Joined: Dec 10, 2003
Posts: 47
Hi,

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
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
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.

Regards.
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' - http://e-docs.bea.com/wls/docs81/webserv/assemble.html#autotype
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Creating Object from XML file