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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:39:12+00:00 2026-06-06T00:39:12+00:00

My application connects to the web-service using ksoap2. The application enables the user to

  • 0

My application connects to the web-service using ksoap2. The application enables the user to change the IP address/URL of the server which gives the web-service (in settings).

The problem is that when the user changes the IP address/URL to an invalid location, the application hangs for a long time and the LogCat shows that the application was unable to connect to the Socket description provided.

How do I fix this ? How do I stop the application from hanging if the Web-service is not found ?

I want the app UI to remain as it is if the web-service is not found. Is there any way to avoid the application from hanging ?

This is my code. Please suggest any means to avoid the application from hanging.

 private void getControlFromServer()  {
    // TODO Auto-generated method stub

    SoapObject request = new SoapObject(NAMESPACE, METHOD_GET_CONTROL);
    SoapSerializationEnvelope envelope = 
        new SoapSerializationEnvelope(SoapEnvelope.VER11); 
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);


HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);




     try {
             androidHttpTransport.call(SOAP_ACTION_GET_CONTROL, envelope);




            SoapObject result=(SoapObject)envelope.getResponse(); //To get the data.

            tvTemp.setText("Received :" + result.getProperty(0).toString()+ " : " + result.getProperty(1).toString() +  " : " + result.getProperty(2).toString() +  " : " + result.getProperty(3).toString() +  " : " + result.getProperty(4).toString() +  " : " + result.getProperty(5).toString() +  " : " + result.getProperty(6).toString());

     } catch (Exception e) {


            tvTemp.setText("Error");
            e.printStackTrace();

        }


}
  • 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-06T00:39:13+00:00Added an answer on June 6, 2026 at 12:39 am

    Set ConnectionTimeOut to your HttpTransportSE object..

    Use latest Use ksoap2 API version 2.5.7 or greater,

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport;
    SoapObject response = null;
    
    try {
            androidHttpTransport = new HttpTransportSE(URL,6000); // Tried Setting the Timeout to 1 Minute
            androidHttpTransport.debug = true;
            androidHttpTransport.call(SOAP_ACTION,envelope);
            response = (SoapObject)envelope.bodyIn;
        } catch (IOException e) {
            e.printStackTrace();
        } catch (XmlPullParserException e) {
            e.printStackTrace();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made an android application which connects to a local web service on my
I'm writing a web application that connects to a database. I'm currently using a
I'm writing my first C# web application that connects to an XML based service.
i'm trying to create an application which connects to internet and consume web services
I have a client which connects to a Web service to get some information.
I am writing an application which uses web services to connect a remote server.I
I have the following code, which connects to a web service and returns an
Application db connection in web service. i haveto connect the db using that web
I made an android application that brings information using a web service, then when
When I attempt to connect to an intranet web service from a web application

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.