Can't add LDAP Query Role to Static Role


I have an LDAP Query role coming from a remote LDAP server.

When I try to add the role to a static role in the system directory service using

IDirectorySession session = DirectorySystemFactory.getDirectorySystem().createSession();
session.addPrincipalToRole(“LDAPQueryRole”, “systemRole”);

I get an error message saying:
[CommonLib.CDS.0002W] retrun null since DN [uid=administrator,ou=people,o=webmethods] doesn’t match baseDN [dc=bku,dc=db,dc=de]

If I add the role manually through the MWS Administration UI it works fine.

Do you know how to solve this issue?



Which user is set when you are you running the code?
Does it have the same privileges as the user that sets the roles manually?

Also, it seems this function only works with static roles and static principals:, java.lang.String)

Best Regards,