jeudi 8 octobre 2015

Java multiple web service calls

I need to write a program in such a way that

  1. I need to get all the application users who registered. This is one web service call.
  2. I will get all information like firstname, lastname, email, otherdata.
  3. I need to get User role name also. But i cannot get this from the above web service call.
  4. So I have to make another call by passing the email id.
  5. Finally I will be appending all the values to one string.

But Iam finally getting only two values like adminRole and respective object and privateOnlyRole and the respective object. Problem is not getting all the list of objects which have only this two roles.

Code is here:

KalturaUserListResponse usersList = getUsers(filter, pager);
            if (usersList.totalCount != 0 && usersList.totalCount >= 1) {
                System.out.println("usersList.totalCount ----->"
                        + usersList.totalCount);
                for (KalturaUser user : usersList.objects) {
                    if (user != null) {
                        // sb.append(",").append(user.email);
                        String userRole = getUserRole(user);
                        if (userRole != null) {
                            if (userRole.equalsIgnoreCase("adminRole")
                                    || userRole
                                            .equalsIgnoreCase("privateOnlyRole")) {
                                // sb.append(",").append(userRole);
                                // validUserRolesList.add(userRole);
                                userRolesMap.put(userRole, user);
                            }
                            if (!userRole.equalsIgnoreCase("adminRole")
                                    || userRole
                                            .equalsIgnoreCase("privateOnlyRole")) {
                                // invalidUserRolesList.add(userRole);
                                // invalidUserRolesMap.put(userRole, user);
                            }
                        }
                    }
                }




Aucun commentaire:

Enregistrer un commentaire