2012-08-28 2 views
6

삼성 갤럭시 탭에서 SOAP 방법을 테스트했으며 정상적으로 작동합니다.Android ICS SOAP 메소드가 작동하지 않습니까?

동일한 코드는 에서 테스트했으며 Android 아이스크림 샌드위치은 작동하지 않습니다. 이 HTTP/1.1 200 OK (200)

같은

다음

내 코드는, 내가 를 인쇄이 코드에서

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);    
      } 

httpResponse.getStatusLine(). toString() 인쇄 값 줄 값은 null이됩니다.

감사합니다. ..

답변

0

이 시도

StrictMode.ThreadPolicy 정책 = 새로운 StrictMode.ThreadPolicy.Builder() permitAll() 구축(); StrictMode.setThreadPolicy (policy);

+0

내 프로젝트에서이 코드를 사용해야하는 곳은 ... ??? – Jeeva123

+0

네트워크 관련 기능을 호출하기 전에 메인 클래스 선언 아래에서 사용하는 것이 더 좋습니다. – chain

관련 문제