wsdl2java and Two Similar Elements

View: New views
3 Messages — Rating Filter:   Alert me  

wsdl2java and Two Similar Elements

by Matthew McKenna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...

Re: wsdl2java and Two Similar Elements

by Amila Suriarachchi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Thu, Oct 29, 2009 at 12:28 PM, Matthew McKenna <mtmckenna001@...> wrote:
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.

this seems to be a problem with ADB. please log a jira with your wsdl file.

try with another databinding framework eg -d xmlbeans, -d jaxbri

thanks,
Amila.

Matthew McKenna
mtmckenna001@...



--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/

Re: wsdl2java and Two Similar Elements

by Matthew McKenna :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

When I use Axis2, I get a whole host of other problems.  With Axis 1.4 (what I am currently using) I get the behavior described
in my original post.

Thanks

Matthew McKenna
mtmckenna001@...

 
On Thursday, October 29, 2009, at 03:09AM, "Amila Suriarachchi" <amilasuriarachchi@...> wrote:
>


On Thu, Oct 29, 2009 at 12:28 PM, Matthew McKenna <mtmckenna001@...> wrote:
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.

this seems to be a problem with ADB. please log a jira with your wsdl file.

try with another databinding framework eg -d xmlbeans, -d jaxbri

thanks,
Amila.

Matthew McKenna
mtmckenna001@...



--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/