users@jax-rpc.java.net

FW: Attribute's corrupted with WSDL2Java

From: Stickley, Jim <JStickley_at_BIRCH.COM>
Date: Mon, 10 Jun 2002 13:01:38 -0500

Please review the following e-mail series. Will underscores be treated
differently in the future?



Jim Stickley

Birch Telecom

(816) 300-6743

jstickley_at_birch.com



-----Original Message-----
From: Stickley, Jim
Sent: Monday, June 10, 2002 12:41 PM
To: 'axis-user_at_xml.apache.org'; 'jsr101-public-comments_at_sun.com'
Subject: RE: Attribute's corrupted with WSDL2Java



I will take this up with the committee which controls the standards for
JAX-RPC. Thanks for your feedback.



Jim Stickley

Birch Telecom

(816) 300-6743

jstickley_at_birch.com



-----Original Message-----
From: butek_at_us.ibm.com [mailto:butek_at_us.ibm.com]
Sent: Monday, June 10, 2002 12:25 PM
To: axis-user_at_xml.apache.org
Subject: RE: Attribute's corrupted with WSDL2Java



I can't disagree with you. All I can say is that JAX-RPC dictates this and
we must follow JAX-RPC. The potential for name clashes is a big failing.
Perhaps this will be addressed if anyone works on a JAX-RPC version 2.

Russell Butek
butek_at_us.ibm.com

Please respond to axis-user_at_xml.apache.org

To: "'axis-user_at_xml.apache.org'" <axis-user_at_xml.apache.org>
cc:
Subject: RE: Attribute's corrupted with WSDL2Java





Also what if we have a WSDL definition as follows:



   <complexType name="MyData">
    <complexContent>
      <sequence>
       <element name="CREATE_BY" nillable="true" type="xsd:string"/>
       <element name="LAST_MOD_BY" nillable="true" type="xsd:string"/>

       < element name="CREATEBY" nillable="true" type="xsd:string"/>
      </sequence>
     </extension>
    </complexContent>
   </complexType>



Now WSDL2Java will generate code with a duplicate symbol and the generated
code will not be able to distinguish CREATE_BY from CREATEBY.



While it is nice to generate more readable code, in the world of code
generators, one should strive for perfect converters.



Another argument to retain an unmangled name is documentation. A good
server will have documentation defining these elements, it will be confusing
to a client when they attempt to match documentation to a mangle set of
code.



Jim Stickley

Birch Telecom

(816) 300-6743

jstickley_at_birch.com



-----Original Message-----
From: Stickley, Jim [mailto:JStickley_at_birch.com <mailto:JStickley_at_birch.com>
]
Sent: Monday, June 10, 2002 10:41 AM
To: 'axis-user_at_xml.apache.org'
Subject: RE: Attribute's corrupted with WSDL2Java



I understand what you are say, but this is not a very robust conversion.
The biggest problem with this is that the WSDL file used in this example was
generated from Java source, and the java source had underscores, now the
generated source does not match the original source, thus the jar file for
the generated source is not interoperable with the original source.



Jim Stickley

Birch Telecom

(816) 300-6743

jstickley_at_birch.com



-----Original Message-----
From: butek_at_us.ibm.com [mailto:butek_at_us.ibm.com <mailto:butek_at_us.ibm.com> ]
Sent: Monday, June 10, 2002 10:12 AM
To: axis-user_at_xml.apache.org
Subject: Re: Attribute's corrupted with WSDL2Java



This isn't a bug. This is what JAX-RPC specifies. It tries to convert XML
names to Java conventional names. One of the rules is, remove each
underscore and force the following character to upper case.

Note that this ONLY affects the Java mappings. What goes across the wire is
the original XML name.

Russell Butek
butek_at_us.ibm.com

Please respond to axis-user_at_xml.apache.org

To: "'axis-user_at_xml.apache.org'" <axis-user_at_xml.apache.org>
cc:
Subject: Attribute's corrupted with WSDL2Java





Any class that has attributes that have underscores in it are not generated
correctly, i.e. the underscores are removed!



Example WSDL (minus unrelated structures):

   <complexType name="MyData">

    <complexContent>

      <sequence>

       <element name="CREATE_BY" nillable="true" type="xsd:string"/>

       <element name="LAST_MOD_BY" nillable="true" type="xsd:string"/>

      </sequence>

     </extension>

    </complexContent>

   </complexType>



 Java code generated by WSDL2Java (minus unrelated code):



public class CSRSessionData extends implements java.io.Serializable {

    private java.lang.String CREATEBY;

    private java.lang.String LASTMODBY;



    public CSRSessionData() {

    }



    public java.lang.String getCREATEBY() {

        return CREATEBY;

    }



    public void setCREATEBY(java.lang.String CREATEBY) {

        this.CREATEBY = CREATEBY;

    }



    public java.lang.String getLASTMODBY() {

        return LASTMODBY;

    }



    public void setLASTMODBY(java.lang.String LASTMODBY) {

        this.LASTMODBY = LASTMODBY;

    }

}



I believe this to be a bug in the WSDL2Java generator.



Jim Stickley

Birch Telecom

(816) 300-6743

jstickley_at_birch.com