Click here to Skip to main content
13,148,503 members (52,547 online)
Rate this:
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 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 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 7-Nov-11 4:14am
Don't know did he check those links or not. Thanks BTW 5! for you too.
jacobjebaraj 7-Nov-11 4:28am
yeah i have checked those links still i could't find solution...
jacobjebaraj 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 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 7-Nov-11 4:29am
Thanks for kind reply MR.Raja
thatraja 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170924.2 | Last Updated 7 Nov 2011
Copyright © CodeProject, 1999-2017
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