This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi I am new to web service technology. I want to know how to generate the java classes from XSD. Which tools are used for web service operations?
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
posted
0
Originally posted by swarupa patil: Which tools are used for web service operations?
When dealing with SOAP based web services you need a WSDL to create a stub with a WSDL2Java compiler. The WSDL refers to XML Schemas but the schemas themselves are not enough. What that WSDL2Java compiler is called depends on the web service toolkit that you are using.
I want to know how to generate the java classes from XSD.
Now if you are simply retrieving an XML document over an HTTP connection then you can use JAXB to do the (un)marshalling.
once you download you need to place your xsd in the bin of the extract and run scomp -out jarname.jar xsdname.xsd (make sure that you point the scomp to the java home by editing it)
a jar will be generated in the bin. add this jar and the lib jars from the extract to your class path. the jar will contain class for the XSD
sudha swami
Ranch Hand
Joined: Apr 24, 2007
Posts: 177
posted
0
Hi, Which one is better whether to use XMLBeans or JAXB. What is the difference between the two. regards sudha
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
posted
0
Originally posted by sudha swami: Which one is better whether to use XMLBeans or JAXB. What is the difference between the two.
JAXB is part of the standard Java distribution starting with Java SE 6 and Java EE 5. XmlBeans is an open source project that predates JAXB - it will always be separate and never be part of the standard Java distribution.
JAXB 1.0 requires Java 1.4. JAXB 2.0 requires Java 1.5. Some XmlBeans versions probably work with pre-1.4.