Thanks, you're right. It works.
minOccurs and maxOccurs are used only for the xs:element.
 

-----Message d'origine-----
De : Dies Koper [mailto:[EMAIL PROTECTED] 
Envoyé : jeudi 9 mars 2006 11:57
À : [email protected]
Objet : Re: Wsdl2java and array generation

Hello Olivier,

As far as I know Axis does not support the minOccurs/maxOccurs attributes on 
sequence (I think it ignores them).

Please put them on element instead:
         <xs:element name="bloc" minOccurs="1" maxOccurs="unbounded">

Regards,
Dies

Olivier Mocquais RD-BIZZ wrote:
> Hi,
> 
> I have a question about wsdl2java ant task of Axis
> 
> I have specified a complex type in a WSDL and used the wsdl2java to 
> generate the java class.
> 
> <?xml version="1.0" encoding="UTF-8"?> <xs:schema 
> xmlns:xs="http://www.w3.org/2001/XMLSchema";
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>    <xs:element name="intervention">
>        <xs:annotation>
>            <xs:documentation>Comment describing your root 
> element</xs:documentation>
>        </xs:annotation>
>        <xs:complexType>
>            <xs:sequence minOccurs="1" maxOccurs="unbounded">
>                <xs:element name="bloc">
>                    <xs:complexType>
>                        <xs:sequence maxOccurs="unbounded">
>                            <xs:element name="item">
>                                <xs:complexType>
>                                    <xs:attribute name="valeur" 
> use="required"/>
>                                    <xs:attribute name="libelle" 
> use="required"/>
>                                </xs:complexType>
>                            </xs:element>
>                        </xs:sequence>
>                        <xs:attribute name="valeur"/>
>                        <xs:attribute name="libelle" use="required"/>
>                    </xs:complexType>
>                </xs:element>
>            </xs:sequence>
>        </xs:complexType>
>    </xs:element>
> </xs:schema>
> 
> And after the generation, I have:
> public class Intervention  implements java.io.Serializable {
>    private generated.InterventionBloc bloc;
>    public Intervention() {}
> ... }
> 
> But I wanted a array of generated.InterventionBloc as I have specified 
> in the xml schema (with maxOccurs="unbounded") private 
> generated.InterventionBloc[] bloc;
> 
> Why it doesn't work ?
> 
> Thanks.
> 
> Olivier


Reply via email to