@XMLRootElement versus @XmlType

katoom400

New Member
What's the difference between annotating a class with \[code\]@XMLRootElement\[/code\] and \[code\]@XMLType\[/code\]. I've been annotating classes with \[code\]@XMLType\[/code\] when the structure will be used more than once within an XML schema and with \[code\]@XMLRootElement\[/code\] when it will be used only once - is this the best approach?A different but related question which I'll include here. The \[code\]@XMLType\[/code\] annotation has an propOrder attribute to specify in which order it's elements appear - is there an equivalent for \[code\]@XMLRootElement\[/code\]?I'm using these annotations in conjunction with JAX-WS annotations to create web services if that makes any difference.
 
Back
Top