LDAPAttribute ldapAttribute = new LDAPAttribute(attr.getName(), values);
attributes.add(ldapAttribute);
}
// Create and send the LDAP request to the server.
ProtocolOp op = new AddRequestProtocolOp(dnStr, attributes);
LDAPMessage msg = new LDAPMessage(DSMLServlet.nextMessageID(), op);
connection.getLDAPWriter().writeMessage(msg);
// Read and decode the LDAP response from the server.
LDAPMessage responseMessage = connection.getLDAPReader().readMessage();