Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8516387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:24:47+00:00 2026-06-11T05:24:47+00:00

No matter what format I try, I can’t send a date from my Android

  • 0

No matter what format I try, I can’t send a date from my Android (Java) app to the .NET web service. I’ve tried sending it as a GregorianCalendar, a Date, a Calendar… Nothing works.

I get a “cannot be serialized” error as a runtime exception. I’m using ksoap2 to manage my web service calls. Any ideas?

Errors below:

java.lang.RuntimeException: Cannot serialize: java.util.GregorianCalendar...
java.lang.RuntimeException: Cannot serialize: java.util.Date...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:24:49+00:00Added an answer on June 11, 2026 at 5:24 am

    Managed to track this down eventually through several dead ends. It seems the ksoap library doesn’t know what to do with dates or doubles to be sent through on the webservice call – you need to tell it how to handle them or it gets a serialization error.

    The way to do this is to implement the MarshalDate class: this tutorial has the code you need to implement it.

    From my experiences, ksoap2 has the MarshalDate class already in the library and that class will do the job, but doesn’t register it against the envelope by default. By registering it against the envelope (as below), the problem was resolved. For doubles or other floating point numbers, use MarshalFloat instead.

    To fix this problem, before you send your SoapSerializationEnvelope through your HttpTransport make this call:

    new MarshalDate().register(envelope);
    

    where envelope is your SoapSerializationEnvelope.

    I found out the ksoap2 library has the MarshalDate and MarshallFloat classes by accident when importing the class, as Eclipse provided me with two options for importing it – one of which was within ksoap2. The included class sufficed and I removed my custom one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No matter what I try, it never matches the sign. I even tried using
No matter how hard I try I can't get this.. This matches the whole
No matter what you read about ASP.NET routing or REST I think the best
No matter what I try I keep getting an infinite loop with this function:
I'm having some trouble displaying the time in this format: HH:mm:ss. No matter what
I'm trying to use android.media.MediaRecorder to record video, and no matter what I do
I have a script for deleting images older than a date. Can I pass
If you use the built in query (EmplTableListPage) from AX2009 and try to build
We have a spring web app with spring mvc controllers. It's supposed to connect
I'm trying to play with a web service via REST. I finally am getting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.