Reputation: 113
I reached naming violation error when try to execute my code :
DBMS_LDAP.USE_EXCEPTION := TRUE;
DBMS_LDAP.UTF8_CONVERSION := false;
v_session := DBMS_LDAP.init(hostname => c_ldap_host,
portnum => c_ldap_port);
v_retval := DBMS_LDAP.simple_bind_s(ld => v_session,
dn => c_ldap_user,
passwd => c_ldap_passwd);
v_array := DBMS_LDAP.create_mod_array(20);
v_vals(1) := 'CN=4321';
DBMS_LDAP.populate_mod_array(v_array,DBMS_LDAP.MOD_ADD,'cn',v_vals);
v_vals(1) := 'DN=4321,' || c_ldap_base;
DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'distinguishedName', v_vals);
v_vals(1) := 'top';
v_vals(2) := 'person';
v_vals(3) := 'organizationalPerson';
v_vals(4) := 'computer';
v_vals(5) := 'user';
DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'objectClass', v_vals);
v_retval := DBMS_LDAP.add_s(ld => v_session,
entrydn => 'DN=4321,' || c_ldap_base,
modptr => v_array);
This code above returns error:
ORA-31202: DBMS_LDAP: LDAP client/server error: Naming violation. 0000209F: UpdErr: DSID-030502EC, problem 6001 (NAME_VIOLATION), data 0
Upvotes: 0
Views: 703
Reputation: 26
Remove the "CN=" from the cn and the "DN=" from the distinguishedName. The CN should just be '4321'. the DN should be 'CN=4321,' || c_ldap_base
Upvotes: 1