Try asking the people involved with kSOAP. This is not a kSOAP list. 2011/10/20 Nicolás Mariano Obregón <[email protected]>
> Any thoughts? > > > > > Saludos.- > ______________________ > Nicolás Mariano Obregón > [email protected] > <http://ar.linkedin.com/in/nmobregon> <http://www.facebook.com/nmobregon> > <http://www.facebook.com/nmobregon> > > > > > El 19 de octubre de 2011 18:24, Nicolás Mariano Obregón < > [email protected]> escribió: > >> Hi all! I'm having a bit of a headache trying to pass an enum object to my >> webservice using KSOAP. >> Here's the code >> >> *This class is the WS main parameter thats owns the enum* >> >> public class MyObject implements KvmSerializable{ >> >> ... >> private MyEnum myEnum; >> ... >> >> @Override >> public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) >> { >> switch (arg0){ >> case 0: >> arg2.type = MyEnum.class; >> arg2.name = "myEnum"; >> break; >> >> case1: >> >> ... >> >> } >> } >> >> >> *This is the enum Class* >> >> public enum MyEnum implements KvmSerializable { >> >> VALUE1, >> VALUE2, >> VALUE3, >> VALUE4; >> >> public String value() { >> return name(); >> } >> >> public static MyEnum fromValue(String v) { >> return valueOf(v); >> } >> >> @Override >> public Object getProperty(int arg0) { >> // TODO Auto-generated method stub >> return value(); >> } >> >> @Override >> public int getPropertyCount() { >> // TODO Auto-generated method stub >> return 1; >> } >> >> @Override >> public void getPropertyInfo(int arg0, Hashtable arg1, PropertyInfo arg2) >> { >> arg2.type = PropertyInfo.STRING_CLASS; >> arg2.name = "value"; >> } >> >> @Override >> public void setProperty(int arg0, Object arg1) { >> } >> } >> >> I'm not very comfortable with this code because I don't really like the >> getPropertyInfo on the enum. >> Any help? Is there anyway to pass an enum as a parameter or I shouldn't be >> using enums here? >> >> Thanks in advance! >> >> ______________________ >> Saludos.- >> Nicolás Mariano Obregón >> [email protected] >> <http://ar.linkedin.com/in/nmobregon> <http://www.facebook.com/nmobregon> >> <http://www.facebook.com/nmobregon> >> >> >> > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, One Low Price! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

