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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:48:50+00:00 2026-05-26T10:48:50+00:00

I have a problem while calling a webservice. I have a .NET web service

  • 0

I have a problem while calling a webservice. I have a .NET web service on the server and the data is in Xml format i need to retreive value from there, and I am using KSOAP2 (2.5.4 jar file)in android 2.2 galaxy add-on. While running the program it is showing force close alert message.here is my code below please check it…

    import org.ksoap2.SoapEnvelope;
    import org.ksoap2.serialization.SoapObject;
    //import org.ksoap2.serialization.SoapPrimitive;
    import org.ksoap2.serialization.SoapSerializationEnvelope;
    import org.ksoap2.transport.HttpTransportSE;

    import android.app.Activity;
     import android.os.Bundle;
         import android.widget.TextView;

          public class SoapActivity extends Activity
   {
         private static String SOAP_ACTION = "http://tempuri.org/GetLabResults";

private static String NAMESPACE = "http://tempuri.org/ ";
private static String METHOD_NAME = "GetLabResults";

private static String URL = "http://192.168.1.19/MOBILETEST/service1.asmx?op=GetLabResults";


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    //Initialize soap request + add parameters
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);        
    request.addProperty("ReportDate","10-11-2011 10:10");


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

    // Make the soap 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;
   // SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
   // String strRes = result.toString();


    if(result != null){
        TextView t = (TextView)this.findViewById(R.id.resultbox);
        t.setText("SOAP response:\n\n" + result.getProperty(0).toString());
    }

}

}

  • 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-26T10:48:51+00:00Added an answer on May 26, 2026 at 10:48 am

    I have a few blog entries on this stuff. It may be of help to you as you try to work with kSOAP2 and Android.

    http://roderickbarnes.com/blog/category/technology/web-services-technology

    I hope this helps.

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

Sidebar

Related Questions

I have a problem returning/processing JSON data while calling $.get() function. Here's the code:
I have a peculiar problem when calling a web service that expects the message
I have a problem while I need to send data using uploadify script. For
I have problem while using jquery maskedinput with asp.net textbox. I have a check
I have a problem while converting a string whose value is dd.mm.yyyy to DateTime
I'm having a big problem when calling a web service from my WPF application.
The problem: I have a web service up and running ok, the problem I
i am getting the web services from the .net web server. while in the
i have a problem when i run a page.jsp : Exception while calling encodeEnd
I have a problem while pasting my contents (or text) generated by Java code

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.