Table of Contents
LDAP4D at A Dog And His Boy

Communication Methods

   

About this section...

This section describes the methods used to do the actual communication with an LDAP server. The underlying mechanism for this is via TCP/IP plugins. Both 4D Internet Commands and Internet Toolkit are supported.



LDAP_Open

Syntax:

result := LDAP_Open (serverName:T; port:LI; useSSL:B)

Description:

Open a connection to the specified server (IP address or DNS name) on the optional specified port optionally using SSL.

Warning:

If you are using LDAP 4D with Internet Toolkit (ITK), ITK must also be initialized using the ITK_Init command.
If you are using 4D Internet Commands, it must have been initialized using the IT_MacTCPInit command.
THIS method uses 0 as an error!!!!

Note:

If the port is not specified then 389 is used. If the SSL parameter is not passed then SSL is OFF. If SSL is TRUE and port = 0 then 636 is used.

Params:

In/Out

Parameter

Type

   

Example or note

->

servername

Text

Can be either an IP address, or a DNS name.

"192.168.1.101" or "ldap.siu.edu"

->

port

Longint

 

optional - default is 389
->

useSSL

Boolean

Attempt SSL connection with server on indicated port

optional - IF port = 0 then 636 is used.

<-

result

Longint

stream reference

0 = error

Example:

$iStreamID:=LDAP_Open("ldap.microsoft.com";389;FALSE)
If ($iStreamID # 0)
  ALERT("The Stream that was opened has ID = "+string($iStreamID))
End If


LDAP_Close

Syntax:

result := LDAP_Close (streamReference;LI)

Description:

Close the connection to server.

Warning:

If you are using LDAP 4D with Internet Toolkit (ITK) ITK must also be initialized using the ITK_Init command.

Note:

 

Params:

In/Out

Parameter

Type

   

Example or note

->

streamReference

Longint

previously returned by call to LDAP_Open

 

<-

result

Longint

status of return

0 = noErr

Example:

$err := LDAP_Close($iStreamRef)
If ($err # 0)
  ALERT("LDAP Close failed")
End If


LDAP_Message_Send

Syntax:

result:=LDAP_Message_Send (streamRef:T;messageID;LI;messageText:T)

Description:

Send a message to LDAP server on previously opened stream.

Warning:

If you are using LDAP 4D with Internet Toolkit (ITK) ITK must also be initialized using the ITK_Init command.

Note:

 

Params:

In/Out

Parameter

Type

   

Example or note

->

streamRef

Longint

stream reference returned from LDAP_Open

 

->

messageID

Longint

previously returned by call to LDAP_Open

 

->

messageText

Text

BER encoded message (see Protocol Messages)

 

<-

result

Longint

status of return

0 = noErr

Example:

$iErr:=LDAP_Message_Send($iStreamRef;$iMessageID;LDAP_Message(2;LDAP_UnbindRequest))


LDAP_Response_Parse

Syntax:

result:=LDAP_Response_Parse (streamRef:T{;timeout:LI})

Description:

Receive an expected response from an LDAP server on previously opened stream.

Warning:

 

Note:

This method sets a number of variables if successful. See Response Methods for detail.

Params:

In/Out

Parameter

Type

 

Example or note

->

streamRef

Longint

stream reference returned from LDAP_Open

 

->

timeout

Longint

timeout in seconds

optional - default is 15 seconds

<-

result

Longint

status of return

0 = noErr

Example:

$iErr:=LDAP_Response_Parse($iStreamRef)

Back to top