Click here to Skip to main content
11,802,762 members (72,409 online)
Rate this: bad
Please Sign up or sign in to vote.
Hello Sir,

In my project i have to get data's from either url-1 or url-2 webservice which has same stored procedure but different data's.whenever i connect to any one of this url at first time it get connected and fetch data from the webservice but if i give another url it returns exception, eventhough my device wifi connectivity is also high.

It works once i changed the wifi turn off and on.

what actually happens......i cant solve is problem......pls help

This is my error No route to host     
at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)
at org.apache.harmony.luni.platform.OSNetworkSystem.connect(
at org.ksoap2.transport.ServiceConnectionSE.connect(
at android.widget.AdapterView.fireOnSelected(
at android.widget.AdapterView.access$200(
at android.widget.AdapterView$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(
at dalvik.system.NativeStart.main(Native Method)
Posted 6-Nov-11 19:41pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try by calling one service at a time. Check are you able to connect to both your Web Services one at a time. From the Exception details it sounds to be your Service is unreachable from the Device.

You may also post your Question on Android Developers Forum.
jacobjebaraj at 7-Nov-11 2:17am
thanks for ur suggestion,

yeah ofcourse i calling one service at a time when i login to my app,after logout have to change the url-1 to url-2 manually which has to be done in my app settings page and then move on to login page to call url-2 webservice,i got this error.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Fix links

android - wcf rest service communication[^]
Android Socket: No route to host[^]
Android's No route to host[^](Results The solution is to set in off the WiFi capabilities, and then re-open WiFi, no problem results) <---Chinese site
RaisKazi at 7-Nov-11 4:05am
Indeed it's rude to downvote from OP for the Answer which is a honest attemp of help. 5ed
thatraja at 7-Nov-11 4:14am
Don't know did he check those links or not. Thanks BTW 5! for you too.
jacobjebaraj at 7-Nov-11 4:28am
yeah i have checked those links still i could't find solution...
jacobjebaraj at 7-Nov-11 4:21am
I'm not given downvote MR.RaisKazi, your answer was really useful but i could't find the solution that's why i have given vote for your solution not demotivate your helping tendency....don mistake.....:-)
thatraja at 7-Nov-11 4:27am
Oops :sigh: Here before some Q/A enquirers did the same thing when they couldn't the answers, so we guessed. Thank you :)
jacobjebaraj at 7-Nov-11 4:29am
Thanks for kind reply MR.Raja
thatraja at 7-Nov-11 4:39am
You welcome. Cheers

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 KrunalRohit 366
1 OriginalGriff 365
2 F-ES Sitecore 295
3 CPallini 270
4 Sergey Alexandrovich Kryukov 239
0 OriginalGriff 2,950
1 Maciej Los 1,910
2 KrunalRohit 1,862
3 CPallini 1,695
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 7 Nov 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100