Refresh Software Support Center

Contact Support
 

Email:
support@refreshsoftware.com

Phone:
508-318-4480


  Link to this page

Home >  GetRoleUsers Function

GetRoleUsers Function

In SR2 v7.04 there is a new webservice functionality called GetRoleUsers(). This is used to obtain the names of Users given a particular role name.

The following JSP code demonstrates this in action:

Authentication auth = new Authentication();

auth.setUser(source_User);
auth.setPassword(source_Pwd);

    URL url = new URL(ENDPOINT_ADDRESS);
    ContentRepositoryServiceEndpoint serv = new ContentRepositoryServiceLocator().getContentRepositoryServicePort(url);
           
            RoleGetUsers rgu = new RoleGetUsers();
               
            Role role = new Role();
            role.setName("");
rgu.setAuthentication(auth);
            rgu.setRole(role);
            try {
                r = serv.getRolesInfo(rgu);
               
               
               
            }
            catch (RemoteException ex) {
                System.out.println(ex);
            }

RoleGetUsersResult r1 = serv.getRoleUsers(x);
    UserInfo[] us = r1.getUserinfo();

For(int i=0;i<us.length;i++)
{
UserInfo uinfo = (UserInfo)us[i];

uinfo.getFirstName();
uinfo.getLastName();
uinfo.getEmail();

//do necessary operation with data obtained
}