File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Axis2 wsdl2java codegen gives different bean structures than Axis1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2 wsdl2java codegen gives different bean structures than Axis1" Watch "Axis2 wsdl2java codegen gives different bean structures than Axis1" New topic
Author

Axis2 wsdl2java codegen gives different bean structures than Axis1

Paul Sigurdson
Greenhorn

Joined: Apr 30, 2008
Posts: 2
I'm having a problem where I can't get Axis2 to generate a java bean class so that it is compabible with how Axis1 generated the java for the same portion of wsdl.

Specifically, with Axis1 the wsld resulted in generating a primitive array, but with Axis2 it generates an additional ArrayOf class and then this new class contains the primative array.
I'm constrained in that I can't change the wsdl (due to backwards compatability with existing clients).

For example, in Axis1 the following wsdl snipit...


<complexType name="ParameterList">
<sequence>
<element name="parameters" nillable="true" type="tns1:ArrayOf_tns1_Parameter"/>
</sequence>
</complexType>

<complexType name="ArrayOf_tns1_Parameter">
<sequence>
<element name="item" minOccurs="0" maxOccurs="unbounded" type="tns1:Parameter"/>
</sequence>
</complexType>

<complexType name="Parameter">
<sequence>
<element name="name" nillable="true" type="xsd:string"/>
<element name="value" nillable="true" type="xsd:string"/>
</sequence>
</complexType>


... generates code with a simple structure something like...

public class ParameterList {
protected Parameter[] parameters;
}

public class Parameter
protected String name;
protected String value;
}


... however, in Axis2 the same wsdl snipt will end up generating something more complex with an extra ArrayOf class...

public class ParameterList {
protected ArrayOf_tns1_Parameter parameters;
}

public class ArrayOf_tns1_Parameter {
protected Parameter[] item ;
}

public class Parameter
protected String name;
protected String value;
}


The question is, how can I get Axis2 to generate these class structures so that they are similar to what is generated by Axis1?
I've tried all the various Axis2-1.4 wsdl2java switches, but none seem to work for me. Has anyone seen this before?
Is there some other configuration that can be done to Axis2 so that the java will be generated as I need it?

Much thanks in advance,
Paul

[ May 15, 2008: Message edited by: Paul Sigurdson ]

[ May 15, 2008: Message edited by: Paul Sigurdson ]
[ May 15, 2008: Message edited by: Paul Sigurdson ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis2 wsdl2java codegen gives different bean structures than Axis1
 
Similar Threads
How to change WSDL schema definition to suit incoming requests?
wsdl2java how to replace primitives?
why Axis doesn't preserve Inheritance ?
java.io.IOException: Type {http://lang.java}Exception is referenced but not defined.
How do I consume Web Services in Swing