I tested SOAP method in samsung galaxy tab and is working fine.
same code i tested on Android ice cream sandwich and is not working.
Below is My code,
HttpPost httppost = new HttpPost("xxxxxx");
httppost.setHeader("Content-type", "text/xml; charset=utf-8");
httppost.setHeader("SOAPAction", SoapAction);
StringEntity se1 = new StringEntity(env,HTTP.UTF_8);
se1.setContentType("text/xml");
se1.setContentEncoding(new BasicHeader(HTTP.CONTENT_TYPE, "text/xml; charset=utf-8"));
httppost.setEntity(se1);
HttpClient httpclient = new DefaultHttpClient();
BasicHttpResponse httpResponse = (BasicHttpResponse) httpclient.execute(httppost);
System.out.println("res------"+httpResponse.getStatusLine().toString()+" code "+httpResponse.getStatusLine().getStatusCode());
//Checking response
if(httpResponse!=null){
inputStream = httpResponse.getEntity().getContent();
BufferedReader r = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder total = new StringBuilder();
String line="";
try {
while ((line = r.readLine()) != null) {
total.append(line);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("line----"+line);
}
In this code I printed httpResponse.getStatusLine().toString() printed value like this
HTTP/1.1 200 OK code 200
but line value getting null.
thanks.
Try this ,
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);