Connection refused when calling SOAP Webservice using Android

后端 未结 3 1106
星月不相逢
星月不相逢 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:43

    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.

    0 讨论(0)
  • 2020-12-11 12:48

    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

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题