aspose file tools*
The moose likes Web Services and the fly likes JAXB in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAXB in eclipse" Watch "JAXB in eclipse" New topic
Author

JAXB in eclipse

bhargavi kakarala
Ranch Hand

Joined: Jan 03, 2002
Posts: 82
Hi,

Are there any samles how to create and run JAXB(Generate schema derived Java classes,Unmarshll XML into Java Objects) in Eclipse IDE.

I was able to generate schema derived classes from command line but now I dont know how to Unmarshall XML doc into JAva Objects.



Thanks in Adavance.


Bhargavi
SCJP2,SCWD,SCBCD,IBM Certified SOA Associate,IBM Certified Architectural Design of SOA Solutions
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
I'm not quite sure what you are asking - seems that there are two questions:

1. How do I run the JAXB binding compiler from Eclipse?

Include a build.xml file in your project that makes use of Sun's XJCTask ant-task (in jaxb-xjc.jar for JAXB 1.0).


Right-click (the build.xml in your project)
Run As
Ant Build

Note that jaxb-xjc.jar is in the "lib" directory specified by the classpath.


2. How do I unmarshal an XML document to a Java content-tree?

Sun's JWSDP 1.6 samples shows how:


To run the (JAXB 1.0) examples you will need to add

jaxb\lib\jaxb-api.jar
jaxb\lib\jaxb-impl.jar
jaxb\lib\jaxb-libs.ja
jwsdp-shared\lib\relaxngDatatype.jar
jwsdp-shared\lib\xsdlib.jar

from the JWSDP 1.6 distribution to your project's Java Build Path.

jaxb\lib\jaxb-xjc.jar is only needed for its ant task and to compile the bindings.

JWSDP 1.6 Tutorial: Chapter 2 Using JAXB
[ February 28, 2006: Message edited by: Peer Reynders ]

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAXB in eclipse
 
Similar Threads
JAX-WS - domain model
Customising generated JAXB Classes with custom annotations
JAXB Customization
Java Objects to XML Mapping
my package doesnt contain ObjectFactory.class or jaxb.index