try {
HttpResponse response = httpClient.execute(method);
int responseCode = response.getStatusLine().getStatusCode();
responeEntity = response.getEntity();
// lets store the result in the output message.
LoadingByteArrayOutputStream bos = new LoadingByteArrayOutputStream();
InputStream is = responeEntity.getContent();
try {
IOHelper.copy(is, bos);
bos.flush();
} finally {
ObjectHelper.close(is, "input stream", null);
}
Message message = exchange.getIn();
message.setBody(bos.createInputStream());
// lets set the headers
Header[] headers = response.getAllHeaders();
HeaderFilterStrategy strategy = endpoint.getHeaderFilterStrategy();
for (Header header : headers) {