Hi, I missed previous posts on this, and I'm not sure what your exact
problem is but maybe the following will help.  I develop using Java2WSDL
then WSDL2Java, and found that for this to work with enums correctly the
original java source needed to have:

 - a getValue() method - String getValue()
 - a fromValue() method - YourEnumClass fromValue(String)
 - a fromString() method - YourEnumClass fromString(String)

Try defining these in your enum class and see how you go!


Steve




                                                                                       
                                                   
                    <Eirik.Wahl@b                                                      
                                                   
                    ravida.no>           To:     <[EMAIL PROTECTED]>            
                                                   
                                         cc:                                           
                                                   
                    19/12/2002           Subject:     RE: Java2WSDL Enum handling 
question                                                
                    16:16                                                              
                                                   
                    Please                                                             
                                                   
                    respond to                                                         
                                                   
                    axis-user                                                          
                                                   
                                                                                       
                                                   
                                                                                       
                                                   



Hi Rajal!

I'm aiming at doing the same, but have had no time yet to look into
this. Since nobody else has answered, I wanted to give you this hint
(although no solution ... yet):

Maybe a way to go is to try this text in your WSDL file, and use
WSDL2Java to see what kind of Java code it generates? The output is
hopefully something java2wsdl expects as input.

On 2002-09-23, 16:35 "Harish Prabandham" wrote:
>Hi,
>
>I defined  a simpleType in wsdl that looks something like this:
>
>
>      <xsd:simpleType name="PlanType">
>        <xsd:restriction base="xsd:int">
>            <xsd:enumeration name="Gold" value="0"/>
>            <xsd:enumeration name="Silver" value="1"/>
>            <xsd:enumeration name="Bronze" value="2"/>
>        </xsd:restriction>
>      </xsd:simpleType>
>
>The resulting wsdl2java generated code does not make use of the "Gold",
>"Silver", "Bronze".  Is there a way I can associate user defined
identifiers
>within the generated code instead of value0, value1 etc. that get
generated
>by default.
>
>
>Thx.
>
>
>Harish

Not much to go on, but could be a way out. Would have tried this myself,
if it wasn't for that I have too little time nowadays. Please let me
know if you find something usefull out from this.

By the way: The question from Harish is till unanswered (as far as I
know).

Regards,
Eirik


> -----Original Message-----
> From: Rajal Shah [mailto:[EMAIL PROTECTED]]
> Sent: 17. desember 2002 20:02
> To: Axis User Mailing List
> Subject: Java2WSDL Enum handling question
>
>
> I've read the discussion thread on enums on this list.. It
> still doesn't
> solve my problem.
>
> I am using the type-safe enumeration in my java class (code
> included below)
> and am hoping to get an enumeration mapping in the WSDL using
> the java2wsdl
> tool. But I am unable to produce it.. Any help in figuring
> out what I'm
> doing wrong would be helpful.
>
> public final class SearchType {
>
>     //this is the dummy constructor requirement for Java2WSDL to work.
>     public SearchType() {
>          this.name = "COMPANY_SEARCH";
>     }
>
>     private SearchType(String name) {
>          this.name = name;
>     }
>
>     private final String name;
>
>     public static final SearchType COMPANY_SEARCH =
>                                       new SearchType
("COMPANY_SEARCH");
>     public static final SearchType SITE_SEARCH =
>                                        new SearchType("SITE_SEARCH");
>     public static final SearchType XYZ_SEARCH = new
> SearchType("XYZ_SEARCH");
>
>     public final String toString() {
>          return name;
>     }
> }
> --
> Rajal
>
>
>




Reply via email to