axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Juha Viskari (JIRA)" <>
Subject [jira] Created: (AXIS-2313) Overlapping element and attribute names rendered incorrectly from WSDL to Java
Date Tue, 22 Nov 2005 14:47:41 GMT
Overlapping element and attribute names rendered incorrectly from WSDL to Java

         Key: AXIS-2313
     Project: Apache Axis
        Type: Bug
  Components: WSDL processing  
    Versions: 1.3    
 Environment: Windows XP
    Reporter: Juha Viskari

A sample WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://example.WebServices" xmlns=""
xmlns:apachesoap="" xmlns:impl="http://example.WebServices"
xmlns:intf="http://example.WebServices" xmlns:soapenc=""
xmlns:tns1="" xmlns:wsdl=""
xmlns:wsdlsoap="" xmlns:xsd="">
  <schema targetNamespace="" xmlns="">
   <import namespace=""/>
   <complexType name="ProblematicType">
	        <element name="duplicatename" type="unsignedLong"/>
        <attribute name="duplicatename" type="unsignedLong" use="required"/>

   <wsdl:message name="ProblematicType">
      <wsdl:part name="fault" type="tns1:ProblematicType"/>
   <wsdl:message name="getSomethingRequest"/>

   <wsdl:portType name="bugSample">
      <wsdl:operation name="getSomething">
         <wsdl:input message="impl:getSomethingRequest" name="getSomethingRequest"/>
         <wsdl:fault message="impl:ProblematicType" name="ProblematicType"/>

   <wsdl:binding name="sample.SoapBinding" type="impl:bugSample">
      <wsdlsoap:binding style="rpc" transport=""/>
      <wsdl:operation name="getSomething">
         <wsdl:input name="getSomethingRequest">
            <wsdlsoap:body encodingStyle="" namespace="http://example.WebServices"
         <wsdl:fault name="ProblematicType">
            <wsdlsoap:fault encodingStyle="" name="ProblematicType"
namespace="http://example.WebServices" use="encoded"/>

   <wsdl:service name="bugSample">
      <wsdl:port binding="impl:sample.SoapBinding" name="bugSample.cfc">
         <wsdlsoap:address location=""/>

WSDL2Java + compilation of the generated Java code reports
    [javac] C:\...\gen-src\namespace\target\sample\ duplicatename
is already defined in ProblematicType
    [javac]            org.apache.axis.types.UnsignedLong duplicatename) {
    [javac]                                               ^

The generated code looks like:

    public ProblematicType(
           org.apache.axis.types.UnsignedLong duplicatename,
           org.apache.axis.types.UnsignedLong duplicatename) {
        this.duplicatename = duplicatename;
        this.duplicatename = duplicatename;

I found the following correction log:

tomj        2004/01/08 13:32:23
  Modified:    java/test/wsdl/clash clash.wsdl
  Fix problem with names pointed out by Zhou Zhu []
  Have the Bean Writer check the variable names for duplicate and
  append a number (starting with 2) on to the end of duplicates.

The referred correction made in axis/wsdl/toJava/ was clearly present in
the sources, but this kind of a WSDL managed to reproduce the problem. I made a quick hack
in writeFullConstructor() in my local version of to check the names in
the same manner as in the earlier submitted correction.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message