簡體   English   中英

ResponseHandler無法在Android的SOAP Web服務中工作嗎?

[英]ResponseHandler not working in SOAP Web services for android?

我已經從此鏈接為Android的SOAP Web服務添加了代碼。 代碼很干凈,但是ResponseHandler的序列沒有任何響應。我也在清單中添加了Internet權限。 請幫助我,我在下面添加了以下代碼段:

ResponseHandler<String> rh=new ResponseHandler<String>() {

    // invoked when client receives response  
    public String handleResponse(HttpResponse response) throws ClientProtocolException, IOException {
        HttpEntity entity = response.getEntity();
        StringBuffer out = new StringBuffer();
        byte[] b = EntityUtils.toByteArray(entity);

        out.append(new String(b, 0, b.length));
        return out.toString();
    }
};

帳單代碼:

 ResponseHandler<String> rh=new ResponseHandler<String>() 

根據下面的現有聲明進行更改...

 ResponseHandler<String> responseHandler = new BasicResponseHandler();
                        String response = httprespons.execute(httpentity, responseHandler);
        try {  
            HttpEntity entity = response.getEntity();

                           StringBuffer out = new StringBuffer();
                           byte[] b = EntityUtils.toByteArray(entity);

                           out.append(new String(b, 0, b.length));
                           return out.toString();

        } catch (ClientProtocolException e) {  
            e.printStackTrace();  
        } catch (IOException e) {  
            e.printStackTrace();  
        } ; 

希望可以幫助^ _ ^ cmiiw ..

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM