2015-05-21 49 views
0

請提出任何解決方案? 我是新來android.I'm得到錯誤,同時調用Web服務正確的方式來調用Web服務使用休息在Android?

W/System.err﹕ java.io.IOException: Method Not Allowed 

這裏是我的活動它調用這需要一個字符串參數,並給出輸出Web服務(方法)。如果使用的AsyncTask人職位代碼片段becos它是調用服務的Android最優選的方式,我會很高興....

public class closingBalance extends ActionBarActivity { 
    protected final String NAMESPACE = "http://xxxxx/"; 

    protected final String METHOD_NAME = "getReportDetails"; 
    protected final String URL = "http://xxxxx?wsdl?shop_num=12345"; 

    HttpClient client = new DefaultHttpClient(); 
    try { 
     HttpResponse res = client.execute(new HttpGet(URL)); 
     StatusLine line = res.getStatusLine(); 
     if(line.getStatusCode() == HttpStatus.SC_OK){ 
      ByteArrayOutputStream out = new ByteArrayOutputStream(); 
      res.getEntity().writeTo(out); 
      String response = out.toString(); 
      System.out.println(response); 
      out.close(); 

     }else{ 
      res.getEntity().getContent().close(); 
      throw new IOException(line.getReasonPhrase()); 
     } 
    } catch (IOException e) { 
     e.printStackTrace(); 
    } 
} 
+0

但這個Web服務有WSDL文件,我可以消耗瞭如何使用休息,凌空或改造呢? – sanjana

回答

相關問題