Android 1.6 ksoap2 "RuntimeException: Cannot serialize: java.util.GregorianCalendar..", while passing datetime parameter

Raju Jadhav picture Raju Jadhav · Oct 23, 2010 · Viewed 9.9k times · Source

I have to call .net web services in android using ksoap2 api. My code is working well for passing parameter as String or int. But it showing "java.lang.RuntimeException: Cannot serialize: java.util.GregorianCalendar....." while passing Calendar object as parameter. I converted date into string and parsed it into date object but it is not woriking.

Anybody help me.

Thank you.

Answer

Glad To Help picture Glad To Help · Nov 24, 2010

The easiest way to pass the date is as string, but if you want to pass it as Date, then you need to write a class the Marshal interface and register the envelope. This basically tells KSOAP how to treat dates. You can consider this post:

Implementing KSOAP Marshal Interface

Hope this helps.