String res=null;
String SOAP_ACTION = "http://www.webserviceX.NET/GetCitiesByCountry";
String NAMESPACE ="http://www.webserviceX.NET/";
String METHOD_NAME = "GetCitiesByCountry";
String URL = "http://www.webservicex.com/globalweather.asmx";
SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
request.addProperty("CountryName", c_name[0]);
Log.e("CountryName", c_name[0]);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet= true;
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION,envelope);
String result= androidHttpTransport.responseDump;
if(result!=null){
//Do Something With the result
}
else {
return null;
}
}
catch (SocketTimeoutException e) {
Log.e("Exception : ","Socket Time Out Exception");
}
catch (Exception e) {
e.printStackTrace();
Log.e("Exception Occurred : ",e.getMessage());
}
Add a code snippet to your website: www.paste.org