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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:09:31+00:00 2026-05-27T21:09:31+00:00

I have a problem with KSOAP2 for android with dependencies on an Android device.

  • 0

I have a problem with KSOAP2 for android with dependencies on an Android device.

I followed the instruction from seesharpgears http://seesharpgears.blogspot.com/2010/10/ksoap-android-web-service-tutorial-with.html

I have a Embarcadero C++ Builder XE2 Server with this function to pass a complex data type.

The function is this:

I tried to create a dummy method witch returns back his request.

I created a class called Category.

But I don’t know why, I am receiving still this data with data type vector:

Here my code:

public void getSettings(String sessionId){
 SoapObject Request = new SoapObject(ProgramSettings.NAMESPACE, "GetCategoryById");
  SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  envelope.dotNet = false;
  envelope.setOutputSoapObject(Request);
  Category C = new Category();
  envelope.addMapping("urn:@:TrackNavMobile", "Category",new Category().getClass());
 // addMapping("urn:@:TrackNavMobile", "Category", cat.getClass());
  String url="http://" + readIp() + ":" + readPort() +"/soap/ITrackNavMobile";
  HttpTransportSE  androidHttpTransport = new HttpTransportSE(url);
  /*
   * Call the web service and retrieve result ... how luvly <3
   * 
   * */
  try
  {
      androidHttpTransport.call(ProgramSettings.SOAP_ACTION, envelope);
      SoapObject response = (SoapObject)envelope.bodyIn;

      //TextView tv = (TextView)findViewById(R.id.textView1);

         for(int i=0;i<response.getPropertyCount();i++)
   {
             new AlertDialog.Builder(this) 
             .setMessage(response.getProperty(0).toString())
             .setNeutralButton("OKi", null)
             .show();

      //if complex type is present then you can cast this to SoapObject and if primitive type is returned you can use toString() to get actuall value.
   }

  }
  catch(Exception e)
  {
      e.printStackTrace();
  }
}    

This is the result with properties…When I am debugging it calls the setCategory method written in Java with the correct values…but it doesn’t return them..
[Category : it.comtec.Category@44f02ea0, return : it.comtec.Category@44f02ea0]

This is my server dummy method witch is called:

 Category*  TTrackNavMobileImpl::GetCategoryById(){
        Category* setup= new Category();
        setup->Name="Thomas";
        setup->CategoryId=1;
        setup->Description="Test1";
        return setup;
 } 

This is the RequestDump:

<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:d="http://www.w3.org/2001/XMLSchema" 
 xmlns:c="http://schemas.xmlsoap.org/soap/encoding/"   
 xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"><v:Header />
  <v:Body>
    <n0:GetCategoryById id="o0" c:root="1"    
     sessionId="FFEF196A3940136D7C141C4F01965D7D" 
     xmlns:n0="http://tempuri.org/" />
  </v:Body>
</v:Envelope>

And this is the ResponseDump:

 <?xml version="1.0"?>
   <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"   
     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"   
    xmlns:NS1="urn:TrackNavMobile-ITrackNavMobile">
    <NS1:GetCategoryByIdResponse xmlns:NS2="urn:@:TrackNavMobile">
     <NS2:Category id="1" xsi:type="NS2:Category">
       <Name xsi:type="xsd:string">Thomas</Name>
       <Description xsi:type="xsd:string">Test1</Description>
       <CategoryId xsi:type="xsd:int">1</CategoryId>
      </NS2:Category><return href="#1"/> 
    </NS1:GetCategoryByIdResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Someone has an Idea?

  • 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-05-27T21:09:32+00:00Added an answer on May 27, 2026 at 9:09 pm

    You have to use getResponse() instead of bodyIn. More details are on various blog posts linked on the site as well as directly on the wiki. You will have to implement the parsing of the response either manually or with marshalling.

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

Sidebar

Related Questions

I have problem while sending messages from android to PC. Messages are send when
I have a problem when access to WSDL resource with basic authentication from android.
I have problem in uploading .doc file to .Net WCF from my Android app.
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
Calling a .net SOAP1.1 web service from android using ksoap2 lib I met a
Have problem while getting data from Memcached on .NET MVC solution. I have this
Hey all, i'm having a little problem with ksoap2 and getting response i have
I have problem when creating a file in encoding 'utf-8' and reading it from
I have problem with sending a object from my webservice. I have created a
I have problem running my app on Android 2.3 (Gingerbread). The app has a

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.