• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Connecting to LDAP via Directory Services
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Connecting to LDAP via Directory Services


  • Subject: Connecting to LDAP via Directory Services
  • From: "Alexander F. Hartner" <email@hidden>
  • Date: Thu, 8 Apr 2004 21:43:15 +0200

I am trying to connect to LDAP via the following sample code. When I
run it I get error -14008 which is eDSNodeNotFound 14008 Specified
node could not be found. I guess that my path is formed incorrectly. I
searched just about everywhere, but I can't find any documentation on
how I must specify the path to be able to connect to ldap.

Any suggestions welcome

Alex

#import "LDAPBrowserController.h"
#import <stdio.h>
#import <DirectoryService/DirectoryService.h>

@implementation LDAPBrowserController

long MyOpenDirNode ( tDirNodeReference *outNodeRef, tDirReference
*gDirRef)
{
long dirStatus = eDSNoErr;
char nodeName[ 256 ] = "ldap://bumblebee:389\0";;
tDataListPtr nodePath = NULL;
printf( "Open Directory Node : " );
fflush( stdout );
printf( "Opening: %s.\n", nodeName );
nodePath = dsBuildFromPath( *gDirRef, nodeName, "/" );
if ( nodePath != NULL )
{
dirStatus = dsOpenDirNode( *gDirRef, nodePath, outNodeRef);
if ( dirStatus == eDSNoErr )
{
printf( "Open succeeded. Node Reference = %lu\n", (unsigned
long)outNodeRef );
}
else
{
printf( "Open node failed. Err = %ld\n", dirStatus );
}
}
return( dirStatus );
}


- (IBAction)go:(id)sender
{
printf("GO \n");
long dirStatus = eDSNoErr;
tDirNodeReference nodeRef = NULL;

tDirReference gDirRef;

dirStatus = dsOpenDirService( &gDirRef );
if ( dirStatus == eDSNoErr )
{
dirStatus = MyOpenDirNode( &nodeRef, &gDirRef );
if ( dirStatus == eDSNoErr )
{
dsCloseDirNode( nodeRef );
}
}
if ( gDirRef != NULL )
{
dirStatus = dsCloseDirService( gDirRef );
}
}
@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: fileExistsAtPath: NO means YES?
  • Next by Date: Re: [OT] Debugger protection (was: Implementing Licensing ...)
  • Previous by thread: Warning about deallocation of document object with registered key value observers
  • Next by thread: Reading data from .clipping file?
  • Index(es):
    • Date
    • Thread