Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am always getting an Error "java.net.SocketTimeoutException: Connection timed out".
As i m sending request using HttpTansportSE its not accepting and after some time getting an error i.e request time failed: java.net.SocketException: Address family not supported by protocol.
So please help me how to handle reponse.
Any help would be appreciated.

What I have tried:

public String webService(String userName,String passWord)
{

SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);

PropertyInfo unamePI = new PropertyInfo();


unamePI.setName("username");

unamePI.setValue(userName);

unamePI.setType(String.class);

PropertyInfo upassPI = new PropertyInfo();

request.addProperty(unamePI);

upassPI.setName("password");

upassPI.setValue(passWord);

upassPI.setType(String.class);

request.addProperty(upassPI);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
envelope.implicitTypes = true;

try
{

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL,15000);

androidHttpTransport.debug = true;

androidHttpTransport.call(SOAP_ACTION, envelope);

response = envelope.getResponse().toString();
Log.i("log_tag", "Response "+response);
}


catch (Exception e)
{

}
return null;

}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900