aspose file tools*
The moose likes Security and the fly likes what's the difference between java sdk and ms outlook when connecting to ldap? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "what Watch "what New topic
Author

what's the difference between java sdk and ms outlook when connecting to ldap?

chris
Greenhorn

Joined: Mar 18, 2003
Posts: 14
Hi,
i'm not sure it's ok to ask a question about ldap itself(not related to security....), but please excuse..

i have a ldap server address using in my ms outlook.
i just put a server address (such as xxx.xxx.xxx ),
and it works nicely searching emails, names.....

what i wanna do is to connect to the ldap server using my java application.
same server address. nothing else..
but it does not work. it gives me exception saying "No Such Object"!
i guess it refers to "ou=people" .
do i have to give more information to java??
does the ms outlook have some specific default setting??
please help..

code as following:
LDAPConnection ld = null;
LDAPEntry findEntry = null;
LDAPSearchResults res = null;
int dn_count=0;
try {
ld = new LDAPConnection();
String MY_HOST = "xxx.xxx.xxx";
int MY_PORT = 389;
ld.connect( MY_HOST, MY_PORT );
String MY_SEARCHBASE = "ou=people";
String MY_FILTER = "objectclass=*";
LDAPSearchConstraints cons = ld.getSearchConstraints();
cons.setBatchSize(0);
res = ld.search( MY_SEARCHBASE,LDAPConnection.SCOPE_SUB,MY_FILTER,null,false,cons);
System.out.println( "AUTO Count : " + res.getCount() );
} catch( LDAPException e ) {
e.printStackTrace();
}
while ( res.hasMoreElements() ) {
try {
findEntry = res.next();
dn_count++;
} catch ( LDAPException e ) {
e.printStackTrace();
}
}
System.out.println( "MANUAL Count : " +dn_count);
if ( (ld != null) && ld.isConnected() ) {
try {
ld.disconnect();
} catch ( LDAPException e ) {
System.out.println( "Error: " + e.toString() );
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what's the difference between java sdk and ms outlook when connecting to ldap?