bagi-code / ksoap2-android

Automatically exported from code.google.com/p/ksoap2-android
0 stars 0 forks source link

Timeout #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi

I'm using ksoap2-android-assembly-2.5.4-jar-with-dependencies.jar and set the 
timeout value in  HttpTransportSE.

The core are:

 HttpTransportSE androidHttpTransport = new HttpTransportSE(URL,2000);

If the internet conection is disabled, works fine but if i have internet 
connection but the server is offline or the web services is down, it's hagns 
and i can't take the app.

How can i control this timeout?

Thanks

Original issue reported on code.google.com by miguelca...@gmail.com on 13 Jun 2011 at 5:27

GoogleCodeExporter commented 8 years ago
I'm running ksoap2-android-assembly-2.5.6-jar-with-dependencies.jar and am 
having the same issue. The timeout value seems to be ignored. 

Original comment by jam.mon...@gmail.com on 1 Jul 2011 at 2:05

GoogleCodeExporter commented 8 years ago
Hi

I'm partialy solved catching this events:

catch (SoapFault e) {
                        return false;

                    }
                    catch (XmlPullParserException e)
                        {        
                            return false;
                        }

                    catch (IOException e)                       {        
                            return false;
                        }

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

And checking internet conection before call ws.

    if (checkInternetConnection() == false)
            {
            /               return false;
            }

The method

 public static boolean checkInternetConnection() 
        {    

            ConnectivityManager cm = (ConnectivityManager) trpda.contexto.getSystemService(Context.CONNECTIVITY_SERVICE);    
            // test for connection    
            if (cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isAvailable() && cm.getActiveNetworkInfo().isConnected()) 
            {        

                return true;    
            } 
            else 
            {        
                return false;    
            }
    }

I hope you can work with this.

Original comment by miguelca...@gmail.com on 1 Jul 2011 at 3:27

GoogleCodeExporter commented 8 years ago
See related issue 52.

Original comment by jam.mon...@gmail.com on 1 Jul 2011 at 3:27

GoogleCodeExporter commented 8 years ago
I might have fixed this with the changes I did for issue 52. Try it out.

Original comment by mosa...@gmail.com on 5 Jul 2011 at 6:07

GoogleCodeExporter commented 8 years ago
will be out 2.5.7

Original comment by mosa...@gmail.com on 6 Jul 2011 at 10:57