axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leon Hwang <hw...@mystrands.com>
Subject Re: [Axis2] Enum
Date Tue, 04 Sep 2007 05:47:44 GMT
Amil,

First, please refer to the attached email.
According to Sanka, the enum type fix is on the table for the next release.
I would like to confirm with you this would be in Axis2 1.4.
By the way, when does it get released? In October?

To respond to your answer:
Yes, wsdl2java might support enum type.
But the problem is that the server spits out a complex type instead of a simple type with
restrictions.
Please try it yourself.
This problem could be solved by writing a custome WSDL or a custome data locator.

However, here's the REAL main problem.
The server does NOT work with any enum type.
You will encounter a runtime exception when it returns or accepts an enum type.

I wonder if this is all solved in the nightly-build version now.

Thanks,

- Leon



Amila Suriarachchi wrote:
> 
> 
> On 9/3/07, *Mark Nüßler* <mark.nuessler@9elements.com 
> <mailto:mark.nuessler@9elements.com>> 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: axis-user-unsubscribe@ws.apache.org
>     <mailto:axis-user-unsubscribe@ws.apache.org>
>      > For additional commands, e-mail: axis-user-help@ws.apache.org
>     <mailto:axis-user-help@ws.apache.org>
>      >
>      >
>      >
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>     <mailto:axis-user-unsubscribe@ws.apache.org>
>     For additional commands, e-mail: axis-user-help@ws.apache.org
>     <mailto:axis-user-help@ws.apache.org>
> 
> 
> 
> 
> -- 
> Amila Suriarachchi,
> WSO2 Inc.

-- 
Leon Hwang
MyStrands, Inc.

work: 1.541.753.4426
mobile: 1.541.740.7511
fax: 1.541.754.6416
email: hwang@MyStrands.com

Mime
View raw message