Forum

This content is now out of date.

Visit Our Community

Get user role in Yellowfin via webservice

Hi Support,

Try to use webservice to retrieve user role for a particular user but it always come back with null. I am using 7.1 and the code snippet as below:
[code]
AdministrationServiceResponse rs = null;
AdministrationServiceRequest rsr = new AdministrationServiceRequest();
AdministrationServiceService ts = new AdministrationServiceServiceLocator("localhost", 8100, "/services/AdministrationService", false);
AdministrationServiceSoapBindingStub rssbs = (AdministrationServiceSoapBindingStub) ts.getAdministrationService();
AdministrationPerson ap = new AdministrationPerson();

rsr.setLoginId("admin@yellowfin.com.au");
rsr.setPassword("test");
rsr.setOrgId(new Integer(1));
rsr.setFunction("GETUSER");
ap.setUserId("admin2@yellowfin.com.au");
rsr.setPerson(ap);

rs = rssbs.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode()) ) {
out.write("successn");
String role = ap.getRoleCode();
if (role == null){
out.write("role is null");
}else{
out.write(role);
}
} else {
out.write("{");
out.write(""status"":""failed""
);
out.write(""""Code"":"""" + rs.getErrorCode() + """""");
out.write(""}"");
}
[/code]

Regards

Thanks for trying Yellowfin

Please complete the form below to request your copy of Yellowfin today.