On 9/3/07, Mark Nüßler <[EMAIL PROTECTED]> wrote:
>
> hello leon,
>
> it seems to me, that java2wsdl and wsdl2java does not support enums.


wsdl2java support this.  in a wsdl enumeration is represented by a simple
type restriction enumeration.
eg.
<simpletype name="test">
  <restriction base = "xs:string">
     <enumeration value="testvalue"/>
  </restriction>
</simpletype>

and this type of xsd are supported in wsdl2java.

a workaround that works 4 me is to replace the enum with a String
> before generating anything.
>
> on the serverside convert your enum to String
>
> Gender g = Gender.MALE;
> String g_send = g.toString();
>
> an on clientside test, if the String is a valid enum
>
> try {
>         Gender g_test = Gender.valueOf(g_send.toUpperCase());
>         System.out.println("valid Gender");
> } catch(Exception e) {
>         System.out.println("invalid Gender");
> }
>
> i know its just a workaround
>
> mfg derMark
>
>
>
>
>
>
>
> Leon Hwang schrieb:
> > Can someone explain how I can return enum type object from Axis2 server?
> >
> > I am using Axis2 1.3 / Tomcat 6.
> >
> > ---------------------------------------------------------------------
> > 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]
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Reply via email to