Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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


java.net.SocketException: No route to host     
at org.apache.harmony.luni.platform.OSNetworkSystem.connectStreamWithTimeoutSocketImpl(Native Method)
at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.java:115)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:244)
at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:533)
at java.net.Socket.connect(Socket.java:1055)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:62)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927)
at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909)
at org.ksoap2.transport.ServiceConnectionSE.connect(ServiceConnectionSE.java:46)
at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:68)
at com.mobile.project.callsdue.activity.NewWebServiceCall.WebServiceUserList(NewWebServiceCall.java:88)
at com.mobile.project.callsdue.activity.CallsDueLoginPage$5.onItemSelected(CallsDueLoginPage.java:659)
at android.widget.AdapterView.fireOnSelected(AdapterView.java:864)
at android.widget.AdapterView.access$200(AdapterView.java:42)
at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:830)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:4914)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Posted

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.
http://groups.google.com/group/android-developers/topics
 
Share this answer
 
Comments
Jacob_cbe 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.
Fix links

android - wcf rest service communication[^]
Android Socket: java.net.SocketException: No route to host[^]
Android's java.net.SocketException: 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
 
Share this answer
 
Comments
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.
Jacob_cbe 7-Nov-11 4:28am    
yeah i have checked those links still i could't find solution...
Jacob_cbe 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 :)

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900