can you please provide me with an example on how to read a chuncked response from a web service in Android
thanks
Edit: I'm try to call a soap web service, that replies to me with a base64 encoded string representing an image
here's the code:
String SOAP_ACTION = "service soap action";
try {
URL u = new URL("server url");
URLConnection uc = u.openConnection();
HttpURLConnection connection = (HttpURLConnection) uc;
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setRequestProperty("SOAPAction", SOAP_ACTION);
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-type", "text/xml; charset=utf-8");
String xmldata="soap request envelope";
//send the request
OutputStream out = connection.getOutputStream();
Writer wout = new OutputStreamWriter(out);
wout.write(xmldata);
wout.flush();
wout.close();
BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String result;
StringBuilder builder=new StringBuilder();
//read response
while ((result=rd.readLine()) != null) {
builder.append(result);
}