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 8680587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:17:21+00:00 2026-06-12T21:17:21+00:00

I need to pass an object from android to a soap web service, but

  • 0

I need to pass an object from android to a soap web service, but I get an error that the driver object is null. How can I pass an object to the soap web service without getting this error?

Here is the object:

<soap:Body>
<CreateDriver xmlns="http://tempuri.org/">
  <objDriver>
    <status>int</status>
    <DriverId>int</DriverId>
    <FirstName>string</FirstName>
    <LastName>string</LastName>
    <AccessCode>string</AccessCode>
    <Picture>string</Picture>
    <Signature>string</Signature>
    <Email>string</Email>
    <Phone>string</Phone>
    <Status>int</Status>
    <CreationDate>dateTime</CreationDate>
    <ModificationDate>dateTime</ModificationDate>
    <CreatedUserId>int</CreatedUserId>
    <CreatedUser>
      <status>int</status>
      <UserID>int</UserID>
      <FirstName>string</FirstName>
      <LastName>string</LastName>
      <UserName>string</UserName>
      <Password>string</Password>
      <ConfirmPassword>string</ConfirmPassword>
      <UserMail>string</UserMail>
      <CreationDate>dateTime</CreationDate>
      <ModificationDate>dateTime</ModificationDate>
      <Status>int</Status>
      <CreatedUserId>int</CreatedUserId>
      <ModifiedUserId>int</ModifiedUserId>
    </CreatedUser>
    <ModifiedUserId>int</ModifiedUserId>
    <ModifiedUser>
      <status>int</status>
      <UserID>int</UserID>
      <FirstName>string</FirstName>
      <LastName>string</LastName>
      <UserName>string</UserName>
      <Password>string</Password>
      <ConfirmPassword>string</ConfirmPassword>
      <UserMail>string</UserMail>
      <CreationDate>dateTime</CreationDate>
      <ModificationDate>dateTime</ModificationDate>
      <Status>int</Status>
      <CreatedUserId>int</CreatedUserId>
      <ModifiedUserId>int</ModifiedUserId>
    </ModifiedUser>
  </objDriver>
  <bytArrPicture>base64Binary</bytArrPicture>
  <bytArrSignature>base64Binary</bytArrSignature>
</CreateDriver>
</soap:Body>
</soap:Envelope>

Here is my code:

public void postData() throws IOException, XmlPullParserException {
    CreateDriver cDriver = new CreateDriver();
    cDriver.setFirstName("n");
    cDriver.setLastName("n");
    SoapObject objDriver = new SoapObject(NAMESPACE, METHOD_NAME);
    objDriver.addProperty("FirstName", "n");
    objDriver.addProperty("LastName", "n");

    // request.
    // request.addProperty("CreateDriverSimple",request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                                                 SoapEnvelope.VER11);
    envelope.setOutputSoapObject(objDriver);
    envelope.dotNet = true;

    // this is the actual part that will call the webservice
    androidHttpTransport.call(SOAP_ACTION, envelope);
    SoapObject result = (SoapObject) envelope.bodyIn;
  • 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-12T21:17:22+00:00Added an answer on June 12, 2026 at 9:17 pm

    check this thread, he had similar problem and the solution was provided there Android ksoap2 parameter issues

                SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);       
    
                //Use this to add parameters
                //request.addProperty("Parameter","Value");
    
                //Declare the version of the SOAP request
                SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
                envelope.setOutputSoapObject(request);
    
                //Needed to make the internet call
                HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
                try {
                    //this is the actual part that will call the webservice
                    androidHttpTransport.call(SOAP_ACTION, envelope);
                } catch (Exception e) {
                    e.printStackTrace();
                }
    
                // Get the SoapResult from the envelope body.
                SoapObject result = (SoapObject)envelope.bodyIn;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to pass a List<string> or List<object> to consume WCF soap service from
I need to pass a Cursor object from one android emulator to another. But
Is there any way in which I can pass/get an object of android context
I need to call a method and pass an object from my custom UITableViewClass
I have a pretty large object that I need to pass to a function
I have the need to pass an object from jstl to a Jquery click
I need to pass a HashMap object from backing bean (JSF) to JavaScript and
Question: How can you pass an instance of an object from the view model
Possible Duplicate: How to pass object from one activity to another in Android While
I'm developing a Java library that can be used within Android, Web and Desktop

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.