axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew McKenna <>
Subject wsdl2java and Two Similar Elements
Date Thu, 29 Oct 2009 06:58:14 GMT

I have a WSDL file that imports several XML schemas.  One of those schemas has the following:

<xs:element name="ITEM-ID">
<xs:sequence maxOccurs="unbounded">
<xs:element ref="emsg:Item-Id"/>

followed very closely by:

<xs:element name="Item-Id">
<xs:extension base="xs:string">
<xs:attribute name="Type" use="required">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="14"/>
<xs:enumeration value="SA"/>
<xs:enumeration value="VN"/>
<xs:enumeration value="CR"/>
<xs:enumeration value="ON"/>
<xs:enumeration value="PK"/>
<xs:enumeration value="TG"/>

In order to generate the appropriate Java code, I am using the following in my build.xml file:

    <taskdef name="wsdl2java" classname="">
        <classpath refid="cp"/>

    <target name="generateJavaFromWSDL" depends="prepare">
        <echo message="Running Axis WSDL2Java tool"/>
        <wsdl2java url="${wsdlpath}/XXXXX.wsdl"
            <mapping namespace="${XXXXA-namespace}"        package="${XXXXA-package-name}"/>
            <mapping namespace="${services-namespace}"     package="${services-package-name}"/>
            <mapping namespace="${exchange-namespace}"   package="${exchange-package-name}"/>
            <mapping namespace="${types-namespace}"         package="${types-package-name}"/>

The problem I am running in to is that wsdl2java generates a file, but the class
and constructor are ItemId.  All references to the ITEMID object in other generated code 'cannot
be resolved'.

My question - Is there some way I can generate the two item id objects?

Thanks very much for any assistance. 

Matthew McKenna

View raw message