Android 1.6的ksoap2" RuntimeException的:无法序列:java.util.GregorianCalendar中..&QUOT ;,同时通过日期时间参数 [英] Android 1.6 ksoap2 "RuntimeException: Cannot serialize: java.util.GregorianCalendar..", while passing datetime parameter
问题描述
我要调用.NET Web服务使用的Android API ksoap2。
我的code是传递参数为String或INT运作良好。但它显示出了java.lang.RuntimeException:无法序列:java.util.GregorianCalendar中.....,而通过日历对象作为参数。我转换成日期字符串并解析它变成日期对象,但它不是woriking。
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.
有人帮我。
感谢您。
推荐答案
通过之日起的最简单方法是字符串,但如果你想将它传递日期,那么你需要写一个类元帅接口和寄存器信封。这主要是告诉KSOAP如何处理日期。你可以考虑这篇文章:
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:
希望这有助于。
这篇关于Android 1.6的ksoap2" RuntimeException的:无法序列:java.util.GregorianCalendar中..&QUOT ;,同时通过日期时间参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!