-
March 7th, 2011, 11:18 AM
#1
Serialize Java object
I'm developing an android application, where I get some object from a .NET web service using SOAP. I have no problem getting my object. I use ksoap2-android to handle the request.
I need a good way to parse this object's types to a complementary Java object. Anyone knows a good way to do this?
It's composed of simple types and other objects composed of simple types.
The only way I know right now, is something like:
Code:
String[] types = o.toString().split(";");
Then parse the string array. There most be an more convenient way to do it?
My object looks like this:
Code:
anyType{
Success=true;
UserMessage=anyType{};
TechnicalMessage=anyType{};
IntValue=0;
DoubleValue=0;
DateTimeValue=0001-01-01T00:00:00;
AgeGroups=anyType{};
SessionConfigurations=anyType{
Client_SessionConfiguration=anyType{
ID=2;
Name=Skoleklasser;
};
Client_SessionConfiguration=anyType{
ID=3;
Name=Virksomheder;
};
Client_SessionConfiguration=anyType{
ID=4;
Name=Gæster;
};
};
ClientSettings=anyType{
ID=1;
HeartBeatIntervalInSeconds=5;
DataVersion=0.15;
};
}
-
March 7th, 2011, 01:34 PM
#2
Re: Serialize Java object
Have you looked at reflection which I believe is supported on Android.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|