Hi Richard:
We don't yet claim to support union types, so I'm not surprised you got some
weirdness. We should probably (as a minimal first step) be better about reporting an
error when we come across a schema construct which we don't understand.
How would unions be represented in java? Something like this?
public class VersionInfo {
public Object value;
public Object getValue() {
return value;
}
public void setValue(Calendar value) {
this.value = value;
}
public void setValue(int value) {
this.value = new Integer(value);
}
}
--Glen
> -----Original Message-----
> From: Richard Emberson [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, April 28, 2002 3:29 PM
> To: [EMAIL PROTECTED]
> Subject: wsdl2java: union of simpleType
>
>
> Using wsdl2java, latest cvs (as of yesterday), when attempt to produce
> Java code for the following
>
> <xsd:simpleType name="VersionInfo">
> <xsd:union memberTypes="xsd:dateTime xsd:int"/>
> </xsd:simpleType>
>
> I get a class with no instance variable(s) nor any getters or
> settors -
> hard to (de)serialize.
>
> If I try:
>
> <xsd:simpleType name="VersionInfo">
> <xsd:union>
> <xsd:simpleType>
> <xsd:restriction base="xsd:dateTime"/>
> </xsd:simpleType>
> <xsd:simpleType>
> <xsd:restriction base="xsd:int"/>
> </xsd:simpleType>
> </xsd:union>
> </xsd:simpleType>
>
> I get:
>
> java.io.IOException: urn:login:VersionInfo already exists
> at
> org.apache.axis.wsdl.toJava.SymbolTable.symbolTablePut(SymbolT
> able.java:1781)
>
> at
> org.apache.axis.wsdl.toJava.SymbolTable.createTypeFromDef(Symb
> olTable.java:749)
>
> at
> org.apache.axis.wsdl.toJava.SymbolTable.addTypes(SymbolTable.java:568)
> at
> org.apache.axis.wsdl.toJava.SymbolTable.addTypes(SymbolTable.java:638)
> at
> org.apache.axis.wsdl.toJava.SymbolTable.addTypes(SymbolTable.java:638)
> at
> org.apache.axis.wsdl.toJava.SymbolTable.addTypes(SymbolTable.java:638)
> at
> org.apache.axis.wsdl.toJava.SymbolTable.addTypes(SymbolTable.java:638)
> at
> org.apache.axis.wsdl.toJava.SymbolTable.addTypes(SymbolTable.java:638)
> at
> org.apache.axis.wsdl.toJava.SymbolTable.addTypes(SymbolTable.java:638)
> at
> org.apache.axis.wsdl.toJava.SymbolTable.populateTypes(SymbolTa
> ble.java:531)
>
> at
> org.apache.axis.wsdl.toJava.SymbolTable.populate(SymbolTable.java:424)
> at
> org.apache.axis.wsdl.toJava.SymbolTable.add(SymbolTable.java:330)
> at org.apache.axis.wsdl.toJava.Emitter.emit(Emitter.java:188)
> at org.apache.axis.wsdl.toJava.Emitter.emit(Emitter.java:155)
> at
> org.apache.axis.wsdl.WSDL2Java$WSDLRunnable.run(WSDL2Java.java:725)
> at java.lang.Thread.run(Thread.java:536)
>
> Last Summer when I wrote a wsdl2java transformer (I used XSL) I found
> unions to be the
> hardest part .... I guess its the hardest part of Axis also
> .... but any
> help would still
> be appreciated.
>
> Richard
>