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 Jigsaw <ji...@hotmail.com> on 2004/07/08 17:17:14 UTC

xsd:list workaround help

Hi,
    Is there a workaround from using xsd:list in a wsdl?
Wsdl2java complains when I use xsd:list  Below is part of schema using
xsd:list

             <element name="stringList">
                     <simpleType>
                    <restriction base="xsd:string">
                        <enumeration value="bp"/>
                        <enumeration value="fp"/>
                        <enumeration value="hm"/>
                        <enumeration value="hmp"/>
                        <enumeration value="hms"/>
                        <enumeration value="hmt"/>
                        <enumeration value="pfs"/>
                        <enumeration value="sreg"/>
                        <enumeration value="sf"/>
                    </restriction>
                </simpleType>
            </element>
            <element name="applicationList">
                <simpleType>
                    <list itemType="stringList"/>
                </simpleType>
            </element>

            <element name="applications">
                            <simpleType>
                                <restriction base="applicationList">
                                    <whiteSpace value="preserve"/>
                                    <minLength value="0"/>
                                    <maxLength value="9"/>
                                </restriction>
                            </simpleType>
            </element>

       <element name="inputParams">
             <complexType>
                <sequence>
                    <element name="apps" type="tns:applications"/>
                        .....
       </element>

The above would give me:
    <inputParams>
        <apps> bp hm </apps>
           .....
     </inputParams>


To use wsdl2java I am trying to convert the above to an array like:
    <inputParams>
        <appList>
            <app> bp </app>
            <app> hm </app>
        </appList>
        ....
    </inputParams>

Now how do I do this?


I tried the following:
            <element name="appListType">
                <complexType>
                      <all>
                    <element name="app" type="xsd:string" maxOccurs="9"/>
                      </all>
                </complexType>
          </element>

            <element name="inputParams">
                <complexType>
                    <sequence>
                                                <element name="appList"
type="appListType" maxOccurs="1"/>

That still complains :-(

Would appreciate any help.

Thanks,
JS