axis-java-user mailing list archives

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

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

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

followed very closely by:

<xs:element name="Item-Id">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="Type" use="required">
<xs:simpleType>
<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"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>

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

    <taskdef name="wsdl2java" classname="org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask">
        <classpath refid="cp"/>
    </taskdef>

    <target name="generateJavaFromWSDL" depends="prepare">
        <echo message="Running Axis WSDL2Java tool"/>
        <wsdl2java url="${wsdlpath}/XXXXX.wsdl"
                output="generated/src"
            serverSide="false"
                all="true"
         wraparrays="true"
            verbose="true">
            <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}"/>
        </wsdl2java>
    </target>


The problem I am running in to is that wsdl2java generates a ITEMID.java file, but the class
declaration
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
mtmckenna001@mac.com

Mime
View raw message