HttpResponse response = client.execute(post);
StatusLine statusLine = response.getStatusLine();
HttpEntity entity = response.getEntity();
if (statusLine.getStatusCode() >= 300) {
EntityUtils.consume(entity);
throw new TransmissionException(statusLine.getReasonPhrase(), statusLine.getStatusCode());
}
return entity == null ? null : EntityUtils.toString(entity);
} catch (SoapException ex) {
throw ex;
} catch (ConnectTimeoutException ex) {
throw new TransmissionException("Connection timed out", ex);
} catch (IOException ex) {
throw new TransmissionException("Transmission failed", ex);
} catch (RuntimeException ex) {
post.abort();
throw new TransmissionException("Transmission aborted", ex);
}
}