웹 서버에 요청해서 응답으로 XML을 받아서 처리하는 간단한 앱을 만드는중입니다.
public static NodeList getList(int id) {
String url = "/getlist.aspx";
url+= "?cate=";
url+= id;
final HttpGet get = new HttpGet(url);
HttpEntity entity = null;
HttpResponse response = null;
try {
final HttpHost host = new HttpHost("xxx.xx.xx.xxx", 5555, "http");
response = HttpManager.execute(host, get);
entity = response.getEntity();
}
catch (IOException e2) {
e2.printStackTrace();
return null;
}
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
return null;
}
// XML 파싱 처리
... ...
위 부분에서
response = HttpManager.execute(host, get);
여기서 멈추어서 서버에서 응답을 받지 못하는 경우가 있는데 원인을 도저히 못찻겠어요...ㅠㅠ
디버그 해서 보면 위 라인까지 실행되고 F6건을 누르면 다음 라인으로 넘어가지 않아요...
제대로 될때도 있고 안될때도 있고...이것때문에 몇일동안 삽질중...:(
웹서버에는 부하가 없고요.. 브라우저로 호출해보면 멈추거나 응답이 늦는 경우가 없거든요...
고수님들 도와주세요. ^_^