try {
String content = httpResponse.body();
if( responseStatus < 300 ) {
commandResponse = deserializeResponseContent(content, JaxbCommandsResponse.class);
} else {
String contentType = httpResponse.contentType();
if( contentType.equals(MediaType.APPLICATION_XML) ) {
exceptionResponse = deserializeResponseContent(content, JaxbExceptionResponse.class);
} else if( contentType.startsWith(MediaType.TEXT_HTML) ) {
exceptionResponse = new JaxbExceptionResponse();
Document doc = Jsoup.parse(content);