users@jaxb.java.net

Re: need some explanation on jaxb generated code

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Wed, 24 Sep 2008 18:44:00 +0200

You don't, by any chance, have an attribute mixed="true" in the
<xs:complexType name="SaisieActeMessage">?

If that's so, then you have XML content that cannot be mapped to a simple
set of unordered class fields, plus one for content. Processors of your
input action message expect to obtain the sub-elements and the chunks (!) of
content one by one, in the order of their appearance.

Cheers
Wolfgang

On 9/24/08, nicolas de loof <nicolas_at_apache.org> wrote:
>
> Hello, I'm an apache CXF user, and I get a strange behaviour with JAXB
> binding. CXF user list forwarded me here for this :
> My (WSDL) schema defines a complextype :
>
> <xs:complexType name="SaisieActeMessage">
> <xs:sequence>
> <xs:element name="adressefacturation" type="tns:Adresse"/>
> <xs:element name="adresselivraison" type="tns:Adresse"/>
> <xs:element name="contact" type="tns:MoyenDeContact"/>
> [~10 more elements] ...
>
> I expected the generated Java class to define attributes
> "adressefacturation", "adresselivraison", "contact" ..., as it does for many
> other types in my WSDL, but I get :
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "SaisieActeMessage", propOrder = {
> "content"
> })
> public class SaisieActeMessage {
>
> @XmlElementRefs({
> @XmlElementRef(name = "adresselivraison", namespace = "http://foo",
> type = JAXBElement.class),
> @XmlElementRef(name = "adresseFacturation", namespace = "http://w foo",
> type = JAXBElement.class),
> @XmlElementRef(name = "contact", namespace = "http://foo", type =
> JAXBElement.class),
> ..... })
> protected List<JAXBElement<?>> content;
>
>
> Is this REALLY what is expected ? Is there no way to have something more
> developer-compliant ?
>