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

  • SEARCH
  • Home
  • 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 8391327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:13:53+00:00 2026-06-09T19:13:53+00:00

I am developing an app in which i nee dto parse date in KSOAP

  • 0

I am developing an app in which i nee dto parse “date” in KSOAP base webservices,i need to Pass Date at server with formate of “MM/dd/yyyy” so i have use SimepldateFormate and pass Date string to that date class but here something is wrong that getting me error like

Error:

08-13 14:45:20.031: ERROR/KsoapDemoActivity(562): Exception=>java.text.ParseException: Unparseable date: "08/01/2011"

i have also rend request with Date Class in KSoap like pi1.setType(Date.class); but not getting solve.I have also tried with make Class MarshalDate mdouble = new MarshalDate(); but not getting solution

can you please help me out this

Here is my code

private void InsertClientDetailForMobApp() {
    // TODO Auto-generated method stub
    try {
        String NAMESPACE = "urn:MobileApplicationIntf-IMobileApplication";// "http://tempuri.org/";
        String METHOD_NAME = "InsertClientDetailForMobApp";
        String SOAP_ACTION = "urn:MobileApplicationIntf-IMobileApplication#InsertClientDetailForMobApp";
        String URL = ("URL");// 

        SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);


        PropertyInfo pi1 = new PropertyInfo();
        pi1.setName("asfirstname");
        pi1.setValue("Nikunj");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi2 = new PropertyInfo();
        pi1.setName("asLastName");
        pi1.setValue("patel");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi3 = new PropertyInfo();
        pi1.setName("asNationalID");
        pi1.setValue("25125514");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi4 = new PropertyInfo();
        pi1.setName("asCountryissued");
        pi1.setValue("asdasdasd");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi5 = new PropertyInfo();
        pi1.setName("asLicenceNo");
        pi1.setValue("asdasd");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi6 = new PropertyInfo();
        pi1.setName("asPassportNo");
        pi1.setValue("12512513221321");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi7 = new PropertyInfo();
        pi1.setName("asGender");
        pi1.setValue("M");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi8 = new PropertyInfo();
        pi1.setName("asAddress1");
        pi1.setValue("Indasdas asd as aia");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi9 = new PropertyInfo();
        pi1.setName("asAddress2");
        pi1.setValue("asdas asd asdasdas ");
        pi1.setType(String.class);
        Request.addProperty(pi1);


        PropertyInfo pi10 = new PropertyInfo();
        pi1.setName("asCountry");
        pi1.setValue("India");
        pi1.setType(String.class);
        Request.addProperty(pi1);


        PropertyInfo pi11 = new PropertyInfo();
        pi1.setName("asCity");
        pi1.setValue("Ahmedabad");
        pi1.setType(String.class);
        Request.addProperty(pi1);


        PropertyInfo pi12 = new PropertyInfo();
        pi1.setName("asProvince");
        pi1.setValue("Gujarat");
        pi1.setType(String.class);
        Request.addProperty(pi1);


        PropertyInfo pi13 = new PropertyInfo();
        pi1.setName("asZip");
        pi1.setValue("356256");
        pi1.setType(String.class);
        Request.addProperty(pi1);


        PropertyInfo pi14 = new PropertyInfo();
        pi1.setName("asDayTelephone");
        pi1.setValue("15165165565456");
        pi1.setType(String.class);
        Request.addProperty(pi1);


        PropertyInfo pi15 = new PropertyInfo();
        pi1.setName("asEveTelephone");
        pi1.setValue("5545654654");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi16 = new PropertyInfo();
        pi1.setName("asFAX");
        pi1.setValue("54145615");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi17 = new PropertyInfo();
        pi1.setName("asEmail");
        pi1.setValue("nkpatel@asd-infotech.com");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi18 = new PropertyInfo();
        pi1.setName("asUserName");
        pi1.setValue("Nik123");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi19 = new PropertyInfo();
        pi1.setName("asPassword");
        pi1.setValue("India");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi20 = new PropertyInfo();
        pi1.setName("asLanguege");
        pi1.setValue("English");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi21 = new PropertyInfo();
        pi1.setName("asQuestion1");
        pi1.setValue("Question1");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi22 = new PropertyInfo();
        pi1.setName("asAnswer1");
        pi1.setValue("Nothing1");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi23 = new PropertyInfo();
        pi1.setName("asQuestion2");
        pi1.setValue("what1");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi24 = new PropertyInfo();
        pi1.setName("asSSN");
        pi1.setValue("123456");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi25 = new PropertyInfo();
        pi1.setName("asAnswer2");
        pi1.setValue("Nothing2");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi26 = new PropertyInfo();
        pi1.setName("asPrimaryCurrency");
        pi1.setValue("INR");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi27 = new PropertyInfo();
        pi1.setName("asSecondaryCurrency");
        pi1.setValue("USD");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi28 = new PropertyInfo();
        pi1.setName("asAgentID");
        pi1.setValue("456");
        pi1.setType(String.class);
        Request.addProperty(pi1);

        PropertyInfo pi29 = new PropertyInfo();
        pi1.setName("asBranchCode");
        pi1.setValue("Tcom India");
        pi1.setType(String.class);
        Request.addProperty(pi1);


        String str_date = "08/01/2011";
        // yyyy-MM-dd'T'HH:mm:ss
        DateFormat formatter;
        Date date;
        //formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        formatter = new SimpleDateFormat("MM-dd-yyyy");
        date = (Date) formatter.parse(str_date);


        PropertyInfo pi30 = new PropertyInfo();
        pi1.setName("dtDOB");
        pi1.setValue(date);
        pi1.setType(Date.class);
        Request.addProperty(pi1);






        /*
         * Call the web service and retrieve result ... how luvly <3
         */





        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                SoapEnvelope.VER11);
        envelope.dotNet = true;
        envelope.setOutputSoapObject(Request);

        AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(
                URL);

        MarshalDate mdouble = new MarshalDate();
        mdouble.register(envelope);



        androidHttpTransport.call(SOAP_ACTION, envelope);
        Log.i("TAG", "soapResponse=>" + envelope.getResponse());
       } catch (Exception e) {
           soapResponseObject = null;
           Log.e(TAG, "niraliwebservice() Exception=>" + e);
       }
}

MarshalDate

package com.KsoapDemo;

import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.kobjects.isodate.IsoDate;
import org.ksoap2.serialization.Marshal;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;


public class MarshalDate implements Marshal
{

        public Object readInstance(XmlPullParser parser, String namespace, String name, 
                PropertyInfo expected) throws IOException, XmlPullParserException {

            return IsoDate.stringToDate(parser.nextText(), IsoDate.DATE_TIME);


        }


        public void register(SoapSerializationEnvelope cm) {
             cm.addMapping(cm.xsd, "DateTime", Date.class, this);

        }


        public void writeInstance(XmlSerializer writer, Object obj) throws IOException {
             writer.text(IsoDate.dateToString((Date) obj, IsoDate.DATE_TIME));
            }

}

UPDATE:

I have Change “08-01-2012” to “08/01/2012”
but now it raise me error

SoapFault – faultcode: ‘SOAP-ENV:Server’ faultstring: ‘Access violation at address 00405818 in module ‘MobileApp.exe’. Read of address 69570A03′ faultactor: ” detail: null

  • 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-09T19:13:54+00:00Added an answer on June 9, 2026 at 7:13 pm

    Use / instead of - in simpleDateFormat…

     formatter = new SimpleDateFormat("MM/dd/yyyy");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an Android app which need to consume .Net webservices over SSL
I have been developing an iPhone app which queries a server that relays data
I am developing an android app in which i need to display images after
Im developing a app which has a user sign-up activity, there I need to
I am developing a app for a movie in which I need to fetch
I am developing j2me app. I need to receive sms on specific port. Which
I am developing an app in which I need to manage users session i.e
I am developing a app in android .... which need a code snippet to
I am developing one app in which i need to call at particular phone
i am developing one app in which i need to show list of product

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.