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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:45:28+00:00 2026-05-26T07:45:28+00:00

I have written an app which fetches data from a server. I am not

  • 0

I have written an app which fetches data from a server. I am not able fetch the data in my 4 activity of my app. And I have written a separate app where it fetches and displays the data in first activity, but when integrated with my app it force closes my app ,i want to display the data in 4th Activity , i am using 2.2 Android with ksoap 2.5.4. I will post my code and the LogCat details.

import org.ksoap2.SoapEnvelope;
import org.ksoap2.SoapFault;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;


public class PatientUpdate extends Activity 
{
private static String SOAP_ACTION ="http://Something.com/GetPatientByID";
private static String NAMESPACE ="http://Something.com/";
private static String METHOD_NAME ="GetPatientByID";
private static String URL ="http://Something/service1.asmx";

EditText patname;
EditText dob;
EditText category;
EditText gender;
EditText addressline1;
EditText addressline2;
EditText addressline3;
EditText addressline4;
EditText phoneno;
EditText mobileno;
EditText RegistrationDate;
EditText validitydate;
EditText monthlyincome;



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

    patname = (EditText) findViewById(R.id.etpatname);
    dob = (EditText) findViewById(R.id.etpatdob);
    category = (EditText) findViewById(R.id.etcategory);
    gender = (EditText) findViewById(R.id.etgender);
    addressline1 = (EditText) findViewById(R.id.etaddline1);
    addressline2 = (EditText) findViewById(R.id.etaddline2);
    addressline3 = (EditText) findViewById(R.id.etaddline3);
    addressline4 = (EditText) findViewById(R.id.etaddline4);
    phoneno = (EditText) findViewById(R.id.etphno);
    mobileno = (EditText) findViewById(R.id.etmobileno);
    RegistrationDate = (EditText) findViewById(R.id.etregister);
    validitydate = (EditText) findViewById(R.id.etvalidity);
    monthlyincome = (EditText) findViewById(R.id.etmoninc);


  //Initialize soap request + add parameters
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    String date1="0019670";
    request.addProperty("patientID",date1);
    System.out.println("dfdjssf");


    // to receive the data from web service
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;//if the data is coming from .net service set it true
    envelope.setOutputSoapObject(request);

 // Make the soap call.
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    System.out.println("dfdjssf");
    try {

        //this is the actual part that will call the webservice
        androidHttpTransport.call(SOAP_ACTION, envelope);
        System.out.println("dfdjssf");
    } catch (Exception e) {
        e.printStackTrace(); 
    }

    // Get the SoapResult from the envelope body.parsethe data here     
    Object result;
    try {
        result = (Object)envelope.getResponse();
        Log.v("TAG", String.valueOf(result));

        //String Patientid=((SoapObject) result).getProperty(0).toString();

        //for salvation and name
        String Salvation=((SoapObject) result).getProperty(1).toString();
        String Name=((SoapObject) result).getProperty(2).toString();
        patname.setText(Salvation+"."+Name);

        //for DOB
        String Dob=((SoapObject) result).getProperty(3).toString();
        dob.setText(Dob);

        //for Gender
        String Gender=((SoapObject) result).getProperty(4).toString();
        gender.setText(Gender);

        //String bloodgroup=((SoapObject) result).getProperty(5).toString();
        //String wardno=((SoapObject) result).getProperty(6).toString();
        //String maritalstatus=((SoapObject)     result).getProperty(7).toString();

        //Address  line 1 2 3 4
        String addline1=((SoapObject) result).getProperty(9).toString();
        addressline1.setText(addline1);

        String addline2=((SoapObject) result).getProperty(10).toString();
        addressline2.setText(addline2);

        String addline3=((SoapObject) result).getProperty(11).toString();
        addressline3.setText(addline3);

        String addline4=((SoapObject) result).getProperty(12).toString();
        addressline3.setText(addline4);

        //for mobile and phone no
        String phno=((SoapObject) result).getProperty(15).toString();
        phoneno.setText(phno);

        String mobno=((SoapObject) result).getProperty(16).toString();
        mobileno.setText(mobno);

        //for category validity registration and monthly income
        String categ=((SoapObject) result).getProperty(22).toString();
        category.setText(categ);

        String regdate=((SoapObject) result).getProperty(23).toString();
        RegistrationDate.setText(regdate);

        String valid=((SoapObject) result).getProperty(24).toString();
        validitydate.setText(valid);

        String montinc=((SoapObject) result).getProperty(27).toString();
        monthlyincome.setText(montinc);


        Log.v("TAG", ((SoapObject) result).getProperty(0).toString());


    } 
    catch (SoapFault e) 
    {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    // Log.v("TAG", String.valueOf(result));
   // SoapPrimitive result = (SoapPrimitive)envelope.getResponse();
   // String strRes = result.toString();


    //if(result != null)
    //{



}
} 

The output is

10-24 10:30:04.766: INFO/ActivityManager(59): Starting activity: Intent { cmp=com.demo.patient/.PatientUpdate }
10-24 10:30:05.004: INFO/System.out(436): dfdjssf
10-24 10:30:05.045: INFO/System.out(436): dfdjssf
10-24 10:30:05.074: WARN/System.err(436): java.net.SocketException: Permission denied
10-24 10:30:05.084: WARN/System.err(436):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method)
10-24 10:30:05.084: WARN/System.err(436):     at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186)
10-24 10:30:05.084: WARN/System.err(436):     at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265)
10-24 10:30:05.095: WARN/System.err(436):     at java.net.Socket.checkClosedAndCreate(Socket.java:873)
10-24 10:30:05.095: WARN/System.err(436):     at java.net.Socket.connect(Socket.java:1020)
10-24 10:30:05.095: WARN/System.err(436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:62)
10-24 10:30:05.105: WARN/System.err(436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)
10-24 10:30:05.105: WARN/System.err(436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)
10-24 10:30:05.105: WARN/System.err(436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)
10-24 10:30:05.105: WARN/System.err(436):     at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:75)
10-24 10:30:05.114: WARN/System.err(436):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:136)
10-24 10:30:05.114: WARN/System.err(436):     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:90)
10-24 10:30:05.124: WARN/System.err(436):     at com.demo.patient.PatientUpdate.onCreate(PatientUpdate.java:77)
10-24 10:30:05.124: WARN/System.err(436):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-24 10:30:05.124: WARN/System.err(436):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-24 10:30:05.124: WARN/System.err(436):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-24 10:30:05.136: WARN/System.err(436):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-24 10:30:05.136: WARN/System.err(436):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-24 10:30:05.136: WARN/System.err(436):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-24 10:30:05.146: WARN/System.err(436):     at android.os.Looper.loop(Looper.java:123)
10-24 10:30:05.146: WARN/System.err(436):     at android.app.ActivityThread.main(ActivityThread.java:4627)
10-24 10:30:05.146: WARN/System.err(436):     at java.lang.reflect.Method.invokeNative(Native Method)
10-24 10:30:05.155: WARN/System.err(436):     at java.lang.reflect.Method.invoke(Method.java:521)
10-24 10:30:05.155: WARN/System.err(436):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-24 10:30:05.165: WARN/System.err(436):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-24 10:30:05.165: WARN/System.err(436):     at dalvik.system.NativeStart.main(Native Method)
10-24 10:30:05.174: DEBUG/AndroidRuntime(436): Shutting down VM
10-24 10:30:05.174: WARN/dalvikvm(436): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-24 10:30:05.195: ERROR/AndroidRuntime(436): FATAL EXCEPTION: main
10-24 10:30:05.195: ERROR/AndroidRuntime(436): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.demo.patient/com.demo.patient.PatientUpdate}: java.lang.NullPointerException
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.os.Looper.loop(Looper.java:123)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.app.ActivityThread.main(ActivityThread.java:4627)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at java.lang.reflect.Method.invokeNative(Native Method)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at java.lang.reflect.Method.invoke(Method.java:521)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at dalvik.system.NativeStart.main(Native Method)
10-24 10:30:05.195: ERROR/AndroidRuntime(436): Caused by: java.lang.NullPointerException
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at org.ksoap2.serialization.SoapSerializationEnvelope.getResponse(SoapSerializationEnvelope.java:552)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at com.demo.patient.PatientUpdate.onCreate(PatientUpdate.java:86)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-24 10:30:05.195: ERROR/AndroidRuntime(436):     ... 11 more
10-24 10:30:05.215: WARN/ActivityManager(59):   Force finishing activity com.demo.patient/.PatientUpdate
10-24 10:30:05.225: WARN/ActivityManager(59):   Force finishing activity com.demo.patient/.Login
10-24 10:30:05.766: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{450e4258 com.demo.patient/.PatientUpdate}
10-24 10:30:14.781: WARN/ActivityManager(59): Launch timeout has expired, giving up wake lock!
10-24 10:30:15.866: WARN/ActivityManager(59): Activity idle timeout for HistoryRecord{45002c48 com.demo.patient/.MyApp}
10-24 10:30:21.060: WARN/ActivityManager(59): Activity destroy timeout for HistoryRecord{450bab00 com.demo.patient/.Login}
10-24 10:30:21.060: WARN/ActivityManager(59): Activity destroy timeout for HistoryRecord{450e4258 com.demo.patient/.PatientUpdate}
10-24 10:30:27.940: DEBUG/SntpClient(59): request time failed: java.net.SocketException: Address family not supported by protocol
  • 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-26T07:45:29+00:00Added an answer on May 26, 2026 at 7:45 am

    Are you sure all arguments are set ?

    If i see right, you just have two of your debug right? It means it fails here :

        androidHttpTransport.call(SOAP_ACTION, envelope);
    

    can you give your soap WS real url ?

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

Sidebar

Related Questions

I have written an app in C which expects two lines at input. First
I have written a app in PHP on my localhost server using XAMP, which
we have WinForms app which stores data in SQL Server (2000, we are working
I have written a c# app to migrate my data from Blinksale to Freeagent.
I have written an app which displays the location of a set of traffic
hi i have written app on vs2008 c# (express edition) on win XP which
I have written a web app in PHP which makes use of Ajax requests
I have a GUI app written in C++/CLI which has a load of configurable
I have a main asp.net app, which is written in asp.net 1.1. Runnning underneath
I have written an android app which listens to the phone signal strength using

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.