android - java.lang.RuntimeException: Cannot serialize: 0.0 -
i making soap request in asynctask getting strange error
04-18 13:51:25.070: e/androidruntime(23482): @ org.ksoap2.serialization.soapserializationenvelope.writeelement(soapserializationenvelope.java:658) 04-18 13:51:25.070: e/androidruntime(23482): @ com.mobilion.afad.registerdevice.getwebservice(registerdevice.java:49) 04-18 13:51:25.070: e/androidruntime(23482): @ com.mobilion.afad.registerdevice.access$0(registerdevice.java:44) 04-18 13:51:25.070: e/androidruntime(23482): @ com.mobilion.afad.registerdevice$requesttask.doinbackground(registerdevice.java:109)
these methods
private boolean getwebservice(string method, soapserializationenvelope soaprequest) { httptransportse httptransport = new httptransportse(soapaddress); try { httptransport.call(soapaction, soaprequest); //httptransport.call(namespace + method, soaprequest); return true; } catch (ioexception e) { e.printstacktrace(); return false; } catch (xmlpullparserexception e) { e.printstacktrace(); return false; } }
and
protected boolean doinbackground(string... params) { soapserializationenvelope envelope = null; //ayarlardan secimi enlemi boylamı al property olarak ekle soapobject request = new soapobject(namespace, "insertuser"); // if(ayarlar.secim == 0){ request.addproperty("deviceid", mdeviceid); request.addproperty("enlem","0"); request.addproperty("boylam", "0"); request.addproperty("depremmin", ayarlar.mindeprem); request.addproperty("depremmax", "10"); request.addproperty("mesafe", "0"); request.addproperty("statu", "1"); request.addproperty("devicetype","2"); envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.dotnet = true; envelope.setoutputsoapobject(request); // } /* else if(ayarlar.secim ==1){ request.addproperty("deviceid", mdeviceid); request.addproperty("enlem",ayarlar.latitude); request.addproperty("boylam", ayarlar.longitude); request.addproperty("depremmin", ayarlar.mindeprem); request.addproperty("depremmax", "10"); request.addproperty("mesafe", ayarlar.maxmesafe); request.addproperty("statu", "1"); request.addproperty("devicetype", "2"); envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.dotnet = true; envelope.setoutputsoapobject(request); } */ return getwebservice("insertuser", envelope); }
here's method throws exception:
private void writeelement(xmlserializer writer, object element, propertyinfo type, object marshal) throws ioexception { if (marshal != null) { ((marshal) marshal).writeinstance(writer, element); } else if (element instanceof soapobject) { writeobjectbody(writer, (soapobject) element); } else if (element instanceof kvmserializable) { writeobjectbody(writer, (kvmserializable) element); } else if (element instanceof vector) { writevectorbody(writer, (vector) element, type.elementtype); } else { throw new runtimeexception("cannot serialize: " + element); } }
as can see, thrown when element
being serialized not 1 of expected types. judging message getting, actual object float
or double
or maybe bigdecimal
instance. i'd @ values putting request properties.
however, there puzzling. according stacktrace, writeelement
method called directly getwebservice
method. however, according source code impossible. did ... ummm ... edit stacktrace? that's bad idea, if want people give accurate diagnosis of problem.
Comments
Post a Comment