axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin D" <kevi...@mindspring.com>
Subject Axis beta 1 interop with .Net [Flags] (WSDL2Java)
Date Wed, 17 Apr 2002 23:32:36 GMT

I created a doc/literal web service using .Net which uses an [Flags] style
enumeration, which is basically an enum which consists of flags that can be
bitwise-OR'd together. In C# you declare this as:

[Flags]
public enum MyFlags
{
  Flag1 = 1,
  Flag2 = 2,
  Flag3 = 4
}

The generated WSDL for this type looks like this:

<s:simpleType name="MyFlags">
  <s:list>
   <s:simpleType>
    <s:restriction base="s:string">
     <s:enumeration value="Flag1" />
     <s:enumeration value="Flag2" />
     <s:enumeration value="Flag3" />
    </s:restriction>
   </s:simpleType>
  </s:list>
</s:simpleType>

When I try running WSDL2Java on the web service, it barfs. The exception is:

java.io.IOException: http://tempuri.org/:MyFlags already exists at
org.apache.axis.wsdl.toJava.SymbolTable.symbolTablePut(Unknown Source)
         at
org.apache.axis.wsdl.toJava.SymbolTable.createTypeFromDef(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.addTypes(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.addTypes(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.addTypes(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.addTypes(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.addTypes(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.addTypes(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.addTypes(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.populateTypes(Unknown
Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.populate(Unknown Source)
         at org.apache.axis.wsdl.toJava.SymbolTable.add(Unknown Source)
         at org.apache.axis.wsdl.toJava.Emitter.emit(Unknown Source)
         at org.apache.axis.wsdl.toJava.Emitter.emit(Unknown Source)
         at org.apache.axis.wsdl.WSDL2Java$WSDLRunnable.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:484)

(sorry if that word-wraps poorly).

If I use a regular enumeration, it all works fine. The WSDL looks like this:

<s:simpleType name="MyEnum">
 <s:restriction base="s:string">
  <s:enumeration value="Flag1" />
  <s:enumeration value="Flag2" />
  <s:enumeration value="Flag3" />
 </s:restriction>
</s:simpleType>

Note the absence of the <list> element.

Anybody know why this doesn't work? It should work, shouldn't it?

Kevin


Mime
View raw message