You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Jongjin Choi <gu...@hotmail.com> on 2004/10/09 07:08:37 UTC

Java artifacts name for Schema Anonymous type

Dear all.

In the current version of Axis, the generated java artifacts name for schema anonymous type
begins with underscore.

For example, in the AddressBook.wsdl in the ws-axis/java/test/wsdl/addrNoImplSEI directory,

<xsd:element name="Phone">
   <xsd:complexType>
      <xsd:all>
           <xsd:element name="areaCode" type="xsd:int"/>
           <xsd:element name="exchange" type="xsd:string"/>
           <xsd:element name="number" type="xsd:string/>
      </xsd:all>
   </xsd:complexType>
</xsd:element>

The generated Java artifact for the element's complex type is '_phone.java'.

This convention may confuse the user because it does not follow general java naming rule. 
It would be better if the generated arftifact name is 'Phone.java' instead of '_phone.java' in this case.

The JSR-109 introduces the new QName scheme for anonymous type.
Currently Axis makes a Java name from the QName by replacing '>' with '_'.
I think that java name can be derived from the QName 
by using empty string instead of '_' and making the character following '>' as upper case.

For example, the QName and its derived java name should be like these:
QName --> java name

X:>root   --> Root
X:>root>inside --> RootInside   ('I' is also upper case)

If name collision occurs, it will be resolved in the resolveNameClashes() method of JavaGeneratorFactory.

It seems that the JAX-RPC 1.1 is not clear for this. But the SUN's JWSDP works the way I said.

I have fixed this in my local axis copy and now am doing the all-tests. 
I passed all-tests with some modification for generated artifacts name to the test cases for wsdl (ws-axis/java/test/wsdl/).

I know that it will break existing application using Axis. 
But the change will provide the users with more friendly names, compatibility with other JAX-RPC runtime 
and less confusion.

Any thought?

=======================================
Jongjin Choi

Java Webservices team, Tmax Soft.
company homepage : 
   http://www.tmax.co.kr
   http://www.tmaxsoft.com                   
email : jjchoe at tmax dot co dot kr
        gunsnroz at hotmail dot com
=======================================

RE: Java artifacts name for Schema Anonymous type

Posted by Ias <ia...@hotmail.com>.
+1 for this approach. (Actually we talked about it before :-)
I'll commit the change after no objection is expressed (within a week or
so?) and Jongjin gives me the diff.

Thanks for your work, Jongjin,

Ias 

> -----Original Message-----
> From: Jongjin Choi [mailto:gunsnroz@hotmail.com] 
> Sent: Saturday, October 09, 2004 6:09 AM
> To: axis-dev@ws.apache.org
> Subject: Java artifacts name for Schema Anonymous type
> 
> Dear all.
> 
> In the current version of Axis, the generated java artifacts 
> name for schema anonymous type begins with underscore.
> 
> For example, in the AddressBook.wsdl in the 
> ws-axis/java/test/wsdl/addrNoImplSEI directory,
> 
> <xsd:element name="Phone">
>    <xsd:complexType>
>       <xsd:all>
>            <xsd:element name="areaCode" type="xsd:int"/>
>            <xsd:element name="exchange" type="xsd:string"/>
>            <xsd:element name="number" type="xsd:string/>
>       </xsd:all>
>    </xsd:complexType>
> </xsd:element>
> 
> The generated Java artifact for the element's complex type is 
> '_phone.java'.
> 
> This convention may confuse the user because it does not 
> follow general java naming rule. 
> It would be better if the generated arftifact name is 
> 'Phone.java' instead of '_phone.java' in this case.
> 
> The JSR-109 introduces the new QName scheme for anonymous type.
> Currently Axis makes a Java name from the QName by replacing 
> '>' with '_'.
> I think that java name can be derived from the QName by using 
> empty string instead of '_' and making the character 
> following '>' as upper case.
> 
> For example, the QName and its derived java name should be like these:
> QName --> java name
> 
> X:>root   --> Root
> X:>root>inside --> RootInside   ('I' is also upper case)
> 
> If name collision occurs, it will be resolved in the 
> resolveNameClashes() method of JavaGeneratorFactory.
> 
> It seems that the JAX-RPC 1.1 is not clear for this. But the 
> SUN's JWSDP works the way I said.
> 
> I have fixed this in my local axis copy and now am doing the 
> all-tests. 
> I passed all-tests with some modification for generated 
> artifacts name to the test cases for wsdl (ws-axis/java/test/wsdl/).
> 
> I know that it will break existing application using Axis. 
> But the change will provide the users with more friendly 
> names, compatibility with other JAX-RPC runtime and less confusion.
> 
> Any thought?
> 
> =======================================
> Jongjin Choi
> 
> Java Webservices team, Tmax Soft.
> company homepage : 
>    http://www.tmax.co.kr
>    http://www.tmaxsoft.com                   
> email : jjchoe at tmax dot co dot kr
>         gunsnroz at hotmail dot com
> =======================================
>