Using LDAP new search service, but have issue in output results doc

Hi,

I am using pub.client.ldap.search service to fetch records. Records are coming, there is no issue in data, but problem is in output. In this service result doc is there and records are coming as children document of it, that is fine, but issue is, the name of children documents are not fixed, it dynamically genereated, so not getting how to map it to my

-results
-cn=spsjsdo22323, ou=Users,o=IAM (first record)
-FullName
-Mail
-…
-cn=spsjsdo23434, ou=Users,o=IAM (seocond records)
-FullName
-Mail
-…
-…

Note- spsjsdo22323, ou=Users,o=IAM is the document1 name which is generated dynamically.

Not gettting why it is not coming in the form of doclist as a child of results doc, as it used to come in old service which is not deprecated.

Canbody can help me on it, any comments?

Please reply me if you need any further details or anything.

Thanks,
BSRAJPUT

I observed the same thing with ldap service in client folder
I think you can try something like below with java, after calling the ldap service

Input: results, cursor:resultsCursor
Output: resultList
while(resultsCursor.next())
{ get each element from resultsCursor and put it in resultList}

Use below code…

// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();

// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
// ldap
IData ldap = IDataFactory.create();
IDataCursor ldapCursor = ldap.getCursor();

// results
IData    results = IDataUtil.getIData( pipelineCursor, "results" );

if ( results != null)
{
    IDataCursor resultsCursor = results.getCursor();
    resultsCursor.first();
    IData    d = IDataUtil.getIData( resultsCursor, resultsCursor.getKey());
    IDataCursor dCursor = d.getCursor();
    while(dCursor.hasMoreData())
    {
    if(dCursor.getKey() != null){
    IDataUtil.put(ldapCursor,dCursor.getKey(),dCursor.getValue());

}
dCursor.next();
}
resultsCursor.destroy();
}

pipelineCursor.destroy();

ldapCursor.destroy();
IDataUtil.put( pipelineCursor_1, “ldap”, ldap );
pipelineCursor_1.destroy();

It will always returns ldap…

–Shaik

Thanks for your help.
We found a better way to do it.
After getting output of new search service, we converted it to xml string and then by using regular expression, we have replaced our dynamic document name to some fix name i.e.

Results (top level document name)
-cn=23423324, out=users (record1 document inside Results )
-cn=32423423, out=users (record2 document inside Results )

“cn=XXXXXXX, out=users” is replaced by records and after that we again converted it to document and now we can see Results is the top level document and inside that we have records list of all the records. This is the same output we used to get from our old search service, so it solved our problem…

Thanks
Bijendra

Sounds Good !!

–Shaik

I had the same problem with my results and tried out both suggestions. The xml was an issue because of our data. The java seems to be the right idea, yet it is not looping over the results. I have a document called results as my input and an object called ldap as the output (also tried an object list). Both return ldap as a document with the data from the first record only. Any advice/suggestions would be greatly appreciated.