Connection refused when calling SOAP Webservice using Android

后端 未结 3 1129
星月不相逢
星月不相逢 2020-12-11 12:17

I developed a webservice in .net and I\'m trying to call it in Android. To call the webservice I\'m using ksoap2.

The WDSL\'s URL is: http://localhost/Cidadaos_Cidad

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 12:49

    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

提交回复
热议问题