// Processing Reponse (Reading and displaying possible errors)
int errorCount = 0;
Dsmlv2ResponseParser responseParser = new Dsmlv2ResponseParser();
responseParser.setInput( response );
LdapResponse ldapResponse = responseParser.getNextResponse();
while ( ldapResponse != null )
{
if ( ( ldapResponse instanceof ErrorResponse )
|| ( ldapResponse.getLdapResult().getResultCode() != ResultCodeEnum.SUCCESS ) )
{
errorCount++;
}
ldapResponse = responseParser.getNextResponse();
}