return new StringRepresentation("Cannot get user due to database error.");
}
try {
DocumentDestination dest = new DocumentDestination();
toXML(user,dest);
InfosetRepresentation rep = new InfosetRepresentation(MediaType.APPLICATION_XML,dest.getDocument());
rep.setCharacterSet(CharacterSet.UTF_8);
return rep;
} catch (XMLException ex) {
getContext().getLogger().log(Level.SEVERE,"Cannot build target list to due to XML exception: "+ex.getMessage(),ex);
getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);
return new StringRepresentation("Internal error, see logs.");