I have struggled with several class implementations to retrieve chunked data without success. Following is a simplified code module that has the problem. After surfing around the web, it appears there have been problems in the past (2009, 2010; ver 1.1, 1.5), but they should be resolved by now. I have not seen any definitive success with Android platform for this protocol.
Help!
I am able to see some response if I put an invalid token -- the web service will respond with an application error message. However, the valid url and token will simply respond with a detection of the chunked protocol (isChunked() returns true), but nothing gets read and nothing times-out, etc.
The exact same URL issued with CURL from a command line works as expected and displays the continuous content (published data from web service).
Are there any web service side hacks e.g., add more end-of-lines, to force the receiving stream??
URI uri;
try {
uri = new URI("http://cws.mycompany.com/service/events?accesskeyid=8226f3ddc65a420abc391d8f1fe12de44766146762_1298174060748");
HttpClient httpClient=new DefaultHttpClient();
HttpGet httpGet=new HttpGet(uri);
ResponseHandler<String> rh=new BasicResponseHandler();
String responseString=httpClient.execute(httpGet,rh);
Log.d(TAG, "response as string:\n" + responseString);
} catch (URISyntaxException e) {
Log.e(TAG, e.toString());
e.printStackTrace();
} catch (ClientProtocolException e) {
Log.e(TAG, e.toString());
e.printStackTrace();
} catch (IOException e) {
Log.e(TAG, e.toString());
e.printStackTrace();
}