public class HRClient {
public static void main(String[] args) {
try {
final Context context = getInitialContext();
HR hR = (HR)context.lookup("HRRestServices-HRBean#nl.amis.rest.hr.model.services.HR");
for (Departments departments : (List<Departments>)hR.getDepartmentsFindAll()) {
printDepartments(departments);
}
} catch (CommunicationException ex) {
System.out.println(ex.getClass().getName());
System.out.println(ex.getRootCause().getLocalizedMessage());