Не удается получить ответ от HttpResponse при передаче объекта soap (soap1.2) для Android
Код:
String response ;
try {
final String SOAP_ACTION = "http://tempuri.org/myAction";
final String URL = "MYURL";
HttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(URL);
String bodyOut = ""
+ " "
+ " "
........ MY Data.......
+ " "
+ " " + "";
StringEntity se = new StringEntity(bodyOut, HTTP.UTF_8);
//StringEntity se = new StringEntity(request1, HTTP.UTF_8);
se.setContentType("text/xml");
httpPost.addHeader("SOAPAction", SOAP_ACTION);
httpPost.setEntity(se);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity resEntity = httpResponse.getEntity();
response = EntityUtils.toString(resEntity);
if (response != null) {
Log.i("Response", "" + response);// this is not being printed
Log.i("test response", "not null");// this is being printed
}
else
Log.i("Response", "null");
} catch (Exception e) {
e.printStackTrace();
}
не исключение, но:Log.i("Response", "" + response);// this is not being printed
LogCat:
08-02 19:04:51.929: I/test response(20413): not null