setCurrentUserRole

This action sets the role of the current user.

Input

Class

Name

Type

Required

Details

SetCurrentUserRoleRequest

userId

String

Yes

The callers user name

SetCurrentUserRoleRequest

password

String

Yes

The callers password

SetCurrentUserRoleRequest

roleId

String

Yes

The new current user role id

Output

Class

Name

Type

Required

Details

SetCurrentUserRoleResponse

success

boolean

Yes

True is succeeded False if failed

SetCurrentUserRoleResponse

returnCode

String

No

See Appendix for details

SetCurrentUserRoleResponse

returnMessage

String

No

Human readable message

Example

public static void testUpdateUserRole(EVUserServiceStub stub) {
try {
GetUserRolesResponse userRoleResponse = getUserRoles(stub);

if (userRoleResponse.getSuccess()) {
SetCurrentUserRoleDocument reqEnvelope
= SetCurrentUserRoleDocument.Factory.newInstance();
SetCurrentUserRoleRequest request
= reqEnvelope.addNewSetCurrentUserRole().addNewRequest();
request.setUserId(ServiceClientHelper.generatedUserId);
request.setPassword(ServiceClientHelper.generatedPassword);
request.setRoleId(userRoleResponse.getRolesArray()[0].getRoleId());

SetCurrentUserRoleResponseDocument resEnvelope
= stub.setCurrentUserRole(reqEnvelope);
SetCurrentUserRoleResponse response
= resEnvelope.getSetCurrentUserRoleResponse().getReturn();

if (response.getSuccess()) {
System.out.println("success: [" +
response.getReturnCode() + "] : " +
response.getReturnMessage());
} else {
System.out.println("failure: [" + response.getReturnCode()
+ "] : "
+ response.getReturnMessage());
}
}

} catch (Exception e) {
e.printStackTrace();
System.err.println("nnn");
}
}