I'm getting a Java Socket Exception "Operation timed out" when trying to call a .NET web service method. I've followed the many examples out there on the web to get my android to call a .net web service.
I'm running the web service using VS2010 in debug mode. The web method I'm calling is very simple -> "string GetVersion()"
I've read some posts that eclipse needs to be configured to access the internet by modifying the Proxy preferences "Preferences -> General -> Network Connections" from the Window menu item. I haven't been able to figure out exactly what I need to configure in the Proxy to get things to work if that is the problem.
I've also tried to access the .net web service root page (service.asmx) from my android with no success. I can access the asmx page with no problems using IE on the local machine. I've turned off the firewall and that didn't solve anything either. This is the first time I've tried to access a web service from a remote computer when it was running using VS2010 in debug mode.
I don't know if I have a configuration issue on the eclipse side or on the VS2010 side.
I'm also running Windows 7 Home Premium.
Any ideas? Thanks, Omar
Below is a code snippet...
private static final String SOAP_ACTION = "http://192.168.1.151/MyWebService/GetVersion";
private static final String METHOD_NAME = "GetVersion";
private static final String NAMESPACE = "http://192.168.1.151/MyWebService";
private static final String URL = "http://192.168.1.151/MyService.asmx";
private void Connect()
{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
System.out.println("DEBUG >> HttpTransport.call()");
try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
}
catch(IOException iexc)
{
System.out.println("EXCEPTION >> " + iexc.toString());
}
catch(XmlPullParserException xexc)
{
System.out.println("EXCEPTION >> " + xexc.toString());
}
try
{
Object result = (Object)envelope.getResponse();
tv.setText(result.toString());
}
catch (SoapFault sp)
{
System.out.println("EXCEPTION >> " + sp.toString());
}
}