Table of Contents
|
LDAP4D at A Dog And His Boy |
LDAP4D - Response Handling |
|
About this section... |
This section describes the methods used to handle data or errors received from a response from an LDAP server. The variables used internally by the methods are cleared/initialized when a search request is created. |
LDAP_iNumAttributeTypes |
||||||||||||||||
Syntax: |
iResult := LDAP_iNumAttributeTypes |
|||||||||||||||
Description: |
Number of attribute types returned by a search request. For the names of the attribute types see the array referenced by LDAP_Pointer2AttributeTypes |
|||||||||||||||
Warning: |
The attribute types are for all the directory tree entries returned by the search. Individual directory tree entries will not necessarily have every attribute type returned. | |||||||||||||||
Note: |
This is just an "accessor" function. It returns the current value of a process variable used internally by LDAP 4D. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$iNumberOfAttributeTypes := LDAP_iNumAttributeTypes |
LDAP_iNumResponses |
||||||||||||||||
Syntax: |
iResult:= LDAP_iNumResponses |
|||||||||||||||
Description: |
Number of responses returned by a search request. |
|||||||||||||||
Warning: |
The size of attribute value arrays are all the same size as this value. | |||||||||||||||
Note: |
This is just an "accessor" function. It returns the current value of a process variable used internally by LDAP 4D. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$iNumberOfResponses := LDAP_iNumResponses |
LDAP_Pointer2AttributeTypes |
||||||||||||||||
Syntax: |
pResult := LDAP_Pointer2AttributeTypes |
|||||||||||||||
Description: |
Pointer to array of attribute type names. This is the "union" of all attribute types returned in all responses from a search. |
|||||||||||||||
Warning: |
||||||||||||||||
Note: |
This is just an "accessor" function. It returns a pointer to a process variable used internally by LDAP 4D. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$arraypointer:=LDAP_Pointer2AttributeTypes COPY ARRAY($arraypointer->;$tA_AttributeTypes) |
LDAP_Pointer2DistinguishedName |
||||||||||||||||
Syntax: |
pResult := LDAP_Pointer2DistinguishedName |
|||||||||||||||
Description: |
Pointer to array of distinguished names. |
|||||||||||||||
Warning: |
None | |||||||||||||||
Note: |
The size of the array will be the same as the number returned by LDAP_iNumResponses. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$arraypointer:=LDAP_Pointer2DistinguishedName COPY ARRAY($arraypointer->;$tA_DistinguishedNames) |
LDAP_Pointer2ResponseAttributes |
||||||||||||||||
Syntax: |
pResult := LDAP_Pointer2ResponseAttributes |
|||||||||||||||
Description: |
Pointer to 2D array of attribute types returned for each response. There will be one row for each response, and multiple columns corresponding to the attributes returned for that response. |
|||||||||||||||
Warning: |
There is a variable number of columns in each row, so you should always check the size of the row before referencing elements. |
|||||||||||||||
Note: |
The number of rows will be the same as the number returned by LDAP_iNumResponses. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$arraypointer:=LDAP_Pointer2ResponseAttributes COPY ARRAY($arraypointer->;$tA_ResponseAttributes) FOR ($i;1;LDAP_iNumResponses) $iNumAttributesForThisResponse:=SIZE OF ARRAY($tA_ResponseAttributes->{$i}) END FOR |
LDAP_ProtocolOp |
||||||||||||||||
Syntax: |
tResult := LDAP_ProtocolOp ($iOperation) |
|||||||||||||||
Description: |
Protocol operation of LDAPMessage per RFC 2251- sec 4.1.1 |
|||||||||||||||
Warning: |
none | |||||||||||||||
Note: |
Pass in a number to get the text response - it's a simple lookup table. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$tText := LDAP_ProtocolOp($iOperation) If ($tText # "Not a recognized protocol operation") ALERT("the LDAP message was " + $tText) End If |
LDAP_ResponseParse |
||||||||||||||||
Syntax: |
iResult := LDAP_ResponseParse ($iLDAPSessionID ) |
|||||||||||||||
Description: |
Call this to read the response from LDAP server into arrays. The arrays can be referenced using the other methods (LDAP_iNumResponses,LDAP_tResultErrorMessage, LDAP_Pointer2AttributeTypes, etc. ) in this section. |
|||||||||||||||
Warning: |
Check that the open returned a valid session or stream ID before calling this method! | |||||||||||||||
Note: |
Check LDAP_tResultErrorMessage for errors. If it is not empty, then something caused the parsing of the response to fail. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$iErr := LDAP_ResponseParse($iLDAPSessionID) If ($iErr = 0) `go about the next step in process... End If |
LDAP_ResultCode |
||||||||||||||||
Syntax: |
tResult := LDAP_ResultCode ($iResultCode ) |
|||||||||||||||
Description: |
Result code text value from an LDAPResult - see RFC 2251 sec 4.1.10 |
|||||||||||||||
Warning: |
none | |||||||||||||||
Note: |
Values are: |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
ALERT("Error on Bind: "+LDAP_ResultCode ($iErr)+Char(13)+LDAP_tResultErrorMessage ) |
LDAP_tFilterErrorMessage |
||||||||||||||||
Syntax: |
tResult := LDAP_tFilterErrorMessage |
|||||||||||||||
Description: |
Error message returned . |
|||||||||||||||
Warning: |
Check this after passing a search filter to LDAP_SearchRequest and before using LDAP_Message_Send to communicate with an LDAP server. Otherwise, the only result you will receive will be a "protocolError". | |||||||||||||||
Note: |
This is just an "accessor" function. It returns the current value of a process variable used internally by LDAP 4D. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$tText := LDAP_tFilterErrorMessage If ($tText = "") `could check result code also... ALERT("LDAP Bind failed") End If |
LDAP_tResultErrorMessage |
||||||||||||||||
Syntax: |
tResult := LDAP_tResultErrorMessage |
|||||||||||||||
Description: |
Error found during the parsing of a result (if any) |
|||||||||||||||
Warning: |
The error message is set by calls to LDAP_Response_Parse. | |||||||||||||||
Note: |
This is just an "accessor" function. It returns the current value of a process variable used internally by LDAP 4D. |
|||||||||||||||
Params: |
|
|||||||||||||||
Example: |
$tText := LDAP_tResultErrorMessage If ($tText # "") `could check result code also... ALERT("LDAP Bind failed") End If |