This is an old problem. Until Axis2 gets code to support java 5 enums,
 I just do a
simple conversion. With this example in the wsdl:

<element minOccurs="1" maxOccurs="1" nillable="true"
name="TipoMibEnum" type="xsd:int"/>

You'd get that value in the Service with the idea of converting it to this:

public enum TipoMib implements Serializable{

       MIB2,
       MIB_GERENCIA,
       MIB_ESPECIFICA;
}

I do the conversion as:

private static TipoMib getTipoMib(Integer ordinal) {
      if (TipoMib.MIB2.ordinal() == ordinal) {
          return TipoMib.MIB2;
      } else if (TipoMib.MIB_ESPECIFICA.ordinal() == ordinal) {
          return TipoMib.MIB_ESPECIFICA;
      } else if (TipoMib.MIB_GERENCIA.ordinal() == ordinal) {
          return TipoMib.MIB_GERENCIA;
      } else
          return null;
}

To convert the other way I do tipoMib.ordinal() - see the javadoc of
Enum about ordinal() .

HTH,
Robert

On 9/21/07, Mathias P.W Nilsson <[EMAIL PROTECTED]> wrote:
>
> Did you find any solution to this? I'm having the same problem
> --
> View this message in context: 
> http://www.nabble.com/-Axis2--Axis2-and-Enum-type-tf4350527.html#a12819819
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to