I am developing a android mobile application using java. I am trying to use a web service to retrieve information from SQL server that resides on my desktop computer to the mobile application. I have created the web service in visual studio. I get the following error when I run the mobile application.
java.net.UnknownHostException
I know something is wrong with the SOAP address I have specified. I know the SOAP address is the URL that i get when I run the web service in visual studio. So when I run the web service the URL is:
http://localhost:54714/WebSite1/Service.asmx
How do I specify the SOAP address? This is some of the code:
private static final String SOAP_ACTION = "http://tempuri.org/findContact";
private static final String OPERATION_NAME = "findContact";// your webservice web metod name
private static final String WSDL_TARGET_NAMESPACE = "http://tempuri.org/";
//What do I have to change in the URL here?
private static final String SOAP_ADDRESS = "http://localhost:54714/WebSite1/Service.asmx";
http: //loacl host:54714 not works for device should be a valid ip address
if sever is on system in which you are running the emulator then can use
IP address 10.0.2.2 see link