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 Harish Prabandham <ha...@mail.finex.com> on 2002/09/23 05:24:10 UTC

WSDL code generation issue

When generating code for anonymous nested simpleTypes within a 
complexType in
a schema definition, I noticed that WSDL2Java generates 
 <elementName>.java,
<elementName>Type0.java so on. For example, If there is a complexType 
with name
foo and another complex type with bar  both these complex types declare an
anonymous simpletype element with a name "baz". The WSDL2Java generates
Baz.java and BazType0.java so on.. It just seems that nested classes 
seems like an  
obvious solution for this.  I was wondering why  WSDL2Java does not 
generate
nested classes  instead.

I also noticed that WSDL2Java generates a class even if all one does is 
add a
pattern/length restriction - this seems very inefficient. Are there any 
plans to
optimize/clean this up?


Harish


Re: WSDL code generation issue

Posted by Harish Prabandham <ha...@mail.finex.com>.
I am attaching a modified AddressBook.wsdl that demonstrates the issue 
that I
mentioned below.  When I run wsdl2java on this wsdl file,  I get the 
following
exception:

java.io.IOException: Duplicate file name: AddressFetcher2/PhoneNumber.java.
Hint: you may have mapped two namespaces with elements of the same name 
to the same package name.
        at 
org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:139)
        at 
org.apache.axis.wsdl.toJava.JavaTypeWriter.generate(JavaTypeWriter.java:144)
        at 
org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGeneratorFactory.java:286)
        at org.apache.axis.wsdl.gen.Parser.generateTypes(Parser.java:357)
        at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:286)
        at org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:83)
        at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:248)
        at 
java.lang.Thread.run(Thread.java:536)                               

WSDL2Java is attempting to create 2 classes within the same namespace 
(PhoneNumber.java).


Harish

Harish Prabandham wrote:

> When generating code for anonymous nested simpleTypes within a 
> complexType in
> a schema definition, I noticed that WSDL2Java generates 
> <elementName>.java,
> <elementName>Type0.java so on. For example, If there is a complexType 
> with name
> foo and another complex type with bar  both these complex types 
> declare an
> anonymous simpletype element with a name "baz". The WSDL2Java generates
> Baz.java and BazType0.java so on.. It just seems that nested classes 
> seems like an  obvious solution for this.  I was wondering why  
> WSDL2Java does not generate
> nested classes  instead.
>
> I also noticed that WSDL2Java generates a class even if all one does 
> is add a
> pattern/length restriction - this seems very inefficient. Are there 
> any plans to
> optimize/clean this up?
>
>
> Harish
>


Re: WSDL code generation issue

Posted by Harish Prabandham <ha...@mail.finex.com>.
I am attaching a modified AddressBook.wsdl that demonstrates the issue 
that I
mentioned below.  When I run wsdl2java on this wsdl file,  I get the 
following
exception:

java.io.IOException: Duplicate file name: AddressFetcher2/PhoneNumber.java.
Hint: you may have mapped two namespaces with elements of the same name 
to the same package name.
        at 
org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:139)
        at 
org.apache.axis.wsdl.toJava.JavaTypeWriter.generate(JavaTypeWriter.java:144)
        at 
org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGeneratorFactory.java:286)
        at org.apache.axis.wsdl.gen.Parser.generateTypes(Parser.java:357)
        at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:286)
        at org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:83)
        at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:248)
        at 
java.lang.Thread.run(Thread.java:536)                               

WSDL2Java is attempting to create 2 classes within the same namespace 
(PhoneNumber.java).


Harish

Harish Prabandham wrote:

> When generating code for anonymous nested simpleTypes within a 
> complexType in
> a schema definition, I noticed that WSDL2Java generates 
> <elementName>.java,
> <elementName>Type0.java so on. For example, If there is a complexType 
> with name
> foo and another complex type with bar  both these complex types 
> declare an
> anonymous simpletype element with a name "baz". The WSDL2Java generates
> Baz.java and BazType0.java so on.. It just seems that nested classes 
> seems like an  obvious solution for this.  I was wondering why  
> WSDL2Java does not generate
> nested classes  instead.
>
> I also noticed that WSDL2Java generates a class even if all one does 
> is add a
> pattern/length restriction - this seems very inefficient. Are there 
> any plans to
> optimize/clean this up?
>
>
> Harish
>