Connection refused when calling SOAP Webservice using Android

浪尽此生 提交于 2019-11-28 13:06:09

i dont know much about android development but localhost is a loopback adress to your android device. you need to replace localhost with the name or ip-address of the server that is running your webservice.

In android when you refer to localhost for web service call it will always give you an error because local host is loop back for android. you have to use the alias address for this. Check this lick to add alias address. connection refused error when calling web service - Android

Actually when we run on service on local host the service runs fine but when we try to access the localhost from android it gives error, the reason is "local host" is a loop back address for the android emulator device. so what you have to do is give the alias address. Use the following IP address to call you web service.

Your web service url in android will look like http://10.0.2.2:PortNumber/WebService.php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!