Question Cécile Heuillet · Jan 24, 2024

Request LDAP

Hello,

I need to make an LDAP query to retrieve information about a specific team of employees. I have a custom service that instantiates a message of type EnsLib.LDAP.Message.Search with a filter matching the search and redirects it to an operation of type EnsLib.LDAP.Operation.Standard. I didn't get any errors, but I didn't get any results either. So I created an operation that inherits from EnsLib.LDAP.Operation.Standard and I overloaded the method to retrieve something. I get this:

ERROR <Ens>ErrException: <FRAMESTACK>ProcessSearch+5^myDSO.operation.requeteLDAP.1 -- - connected as '-' number - @' Set tSC=..ProcessSearch(pRequest, .pResults) '

Does anyone have an idea? Any advice?

Thank you in advance for your help. Best regards,

Cecile

 

UPDATE:

I tried to move forward. I switched back to standard LDAP operation. I checked my settings and connection rights, everything is ok. I really feel like I'm missing out on something and that I'm not connecting correctly to do my LDAP query because I'm getting this as a return message:

And I don't get any EnsLib.LDAP.Message.Result type messages. I put a very simple filter and attribute to return for now.

Could someone please guide me? Or if you didn't have an operation created from scratch, does anyone have an example to show me?

Thank you in advance for your help. Best regards,

Cecile

Comments

DC AI Bot · May 25 Bot

You should expect the LDAP search response to be an EnsLib.LDAP.Message.Results, and then iterate through its Results collection, where each item is an EnsLib.LDAP.Message.Result. Each result contains a DN and an Attributes collection, and each attribute can be read from Name, Result, and Value. A working example is: [1]

#dim results As EnsLib.LDAP.Message.Results
for i=1:1:results.Results.Count() {
    #dim result As EnsLib.LDAP.Message.Result
    set result = results.Results.GetAt(i)
    write "DN: ", result.DN, !
    write "Attributes: ", !
    for j=1:1:result.Attributes.Count() {
        #dim atribute As EnsLib.LDAP.Message.Attribute
        set atribute = result.Attributes.GetAt(j)
        write $$$FormatText(" - Name: %1, Result: %2, Value: %3", atribute.Name, atribute.Result, atribute.Value), !
    }
}

So if you are not receiving any EnsLib.LDAP.Message.Result entries, the useful check is whether your response object is actually an EnsLib.LDAP.Message.Results and whether results.Results.Count() is greater than zero. [1]

For production integration, the LDAP adapter support mentioned in the retrieved material is EnsLib.LDAP.OutboundAdapter, which is used by Business Services to send requests to an LDAP server and receive responses. [2]

From the material retrieved, there is no documented example showing how to build the search request itself, no explanation of the ProcessSearch+5 frame stack error in your subclass, and no complete example of a custom operation inheriting from EnsLib.LDAP.Operation.Standard. The only concrete guidance available here is how the successful search response is structured and how to read it. [1][2]


Sources:

Tell us more:
Don't like the style
Not factually correct
Didn't fully follow instructions
Refused when it shouldn't have
Being lazy
More...
Submit
0 0