I use ksoap2 in android
to send list of numbers as string
But it have error:
java.lang.runtimeexception cannot serialize
I search a solution
Use this class for Serialization
public class MarshalDouble implements Marshal {
public Object readInstance(XmlPullParser parser, String namespace,
String name, PropertyInfo expected) throws IOException,
XmlPullParserException {
return Double.parseDouble(parser.nextText());
}
public void register(SoapSerializationEnvelope cm) {
cm.addMapping(cm.xsd, "double", Double.class, this);
}
public void writeInstance(XmlSerializer writer, Object obj)
throws IOException {
writer.text(obj.toString());
}
}
Add this line to envelop
envelope.dotNet = true;
envelope.implicitTypes = true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;
MarshalDouble md = new MarshalDouble();
md.register(envelope);