Re: Java 5 enums with Axis 1.2



On 31 Aug 2005 07:34:13 -0700, "Markus Weseloh"
<Markus.Weseloh@xxxxxxxx> wrote or quoted :

>we develop a prototype using JDK 1.5. In this prototype we use Axis 1.2
>for SOAP communication between the client and the server (Tomcat
>5.5.9). Our problem is that we want to use the new Java 5 enums but
>Axis 1.2 won't work with them (e.g. when a get method returns an enum).
>Is it possible to write user defined serializer and deserializer to
>support Java 5 enums? Or is there a standard solution? Or is it
>impossible at all :-)?

You could write the ordinal or the name instead.

You need a dummy class on the other end with the same name as the enum
or the enum constant (if you added custom methods to it) that will
behave sufficiently like an enum. Then it would not need custom
serialisation.


You could decompile the enum code to get you a first shot at such
code. The enums in 1.4 still won't work in case labels.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
.



Relevant Pages

  • Apache Axis and JDK1.5
    ... I have downloaded axis1.2rc and try to compile with the 1.5 ... package name. ... ("enum" is a reserved word in Java 1.5; ... Can I conclude that Apache Axis is a dead project? ...
    (comp.lang.java.programmer)
  • Re: enum type declaration error
    ... there is C equivalent "enum" type existed in JAVA. ... initial experiment is giving compile error as below. ... public enum returnStatus ...
    (comp.lang.java.programmer)
  • Re: Jython inherit from Java class
    ... Compiling .java to .class... ... 'assert' is a keyword, and may not be used as an identifier ... release 1.5, 'enum' is a keyword, and may not be used as an identifier ...
    (comp.lang.python)
  • Re: A class that uses instances of itself? Is this right?
    ... > I was recently sent some Java code that I find VERY odd. ... > public String getText() { ... 'TypeSafe enum' pattern. ... public void aMethodDoingSomethingOnEnum{ ...
    (comp.lang.java.programmer)
  • Re: Magic Numbers dangerous?
    ... > I am not up on recent Java features but I did look at the enum type prior to ... > deciding to use named constants in the example above. ... The elements of an enumeration have nothing to ...
    (comp.lang.java.programmer)