0
Guys I created a webservice Soap in java, I consume and perform operations in various methods, however when I will perform operations passing a double value occurs the following error:
java.lang.RuntimeException: Cannot serialize: <Valor double>
Follow the complete error:
E/AndroidRuntime: FATAL EXCEPTION: Thread-1815
Process: br.com.estudoemvideo, PID: 16300
java.lang.RuntimeException: Cannot serialize: 4.0
at org.ksoap2.serialization.SoapSerializationEnvelope.writeElement(SoapSerializationEnvelope.java:784)
at org.ksoap2.serialization.SoapSerializationEnvelope.writeProperty(SoapSerializationEnvelope.java:764)
at org.ksoap2.serialization.SoapSerializationEnvelope.writeObjectBody(SoapSerializationEnvelope.java:688)
at org.ksoap2.serialization.SoapSerializationEnvelope.writeObjectBodyWithAttributes(SoapSerializationEnvelope.java:664)
at org.ksoap2.serialization.SoapSerializationEnvelope.writeElement(SoapSerializationEnvelope.java:777)
at org.ksoap2.serialization.SoapSerializationEnvelope.writeBody(SoapSerializationEnvelope.java:634)
at org.ksoap2.SoapEnvelope.write(SoapEnvelope.java:205)
at org.ksoap2.transport.Transport.createRequestData(Transport.java:153)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:149)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:118)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:113)
I am using the KSOAP2 library to consume the webservice.
I solved my problem, but it’s not a solution to the error. I played the webservice data type for String, and in my webservice method I convert from String to double. It worked for me but it’s not the right way to do it.
– Linneker