Monday, March 14, 2005

Enumeration types and Apache Axis WSDL2Java

I ran into a interesting situation today with Apache Axis. If any of your enumeration values in your enumeration definition start with a number (i.e. 3DES), Apache Axis WSDL2Java generation tool will generate static enumeration instances with nonsense names (i.e. VALUE1, VALUE2, ... VALUEn). Not at all what I was expecting. Seems your values have to abide by Java naming standards for variables if you want Apache Axis to use the value strings as the variable names for the enumeration instances. If any of the values is not compliant, Axis dumps down into the aforementioned VALUEn naming scheme for all values. It would be helpful if Axis dumped a block comment into the generated enumeration Java type stating why the names are nonsense.

1 comment: