You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jordan Lee <jo...@shaw.ca> on 2006/03/17 00:10:55 UTC

Axis 1.3: Difficulty generating arrays (maxoccurs = xx)

We're seeing some odd behaviour with Axis Java class generation:

When the following complexType definition:

<xsd:complexType name="Parent">
<xsd:sequence>
			<xsd:element name="child" type="ns:Child" minOccurs="0" maxOccurs="6"/>
</xsd:sequence>
<xsd:attribute name="date" type="xsd:date" required="true"/>
</xsd:complexType>

it incorrectly generates the following:
setParent(Child[] child), leaving the user with no way to set 'date'

instead of generating setParent(Parent), with Parent having setChild(Child[] child) and setDate(Date date)

we found that the following does work:

<xsd:complexType name="Parent">
<xsd:sequence>
			<xsd:element name="child" type="ns:Child" minOccurs="0" maxOccurs="6"/>
	<xsd:element name="date" type="xsd:date"/>
</xsd:sequence>
</xsd:complexType>

Tried this with XMLBeans, which generates the correct code either way. Does anyone know anything about this?

Jordan.