Solved

LDAP connection?

Posted on 2006-06-30
9
660 Views
Last Modified: 2011-08-18
Hi Experts,

I have to retrieve some information from some server somewhere in the network, I asked the network people here
and they told me they can help me if I can define a LDAP connection... So I told them:

 "Hey... no problem.. it's an AS/400 so of course it is possible"  

I'm almost sure that I am right, but I just have to know how....
please can someone tell me how to define an LDAP connection and how it is globaly working ?

Thanks a lot, and have a nice weekend.

Murph
0
Comment
Question by:theo kouwenhoven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 14

Expert Comment

by:daveslater
ID: 17017976
Hi
I have not set one up but here is a red book with the details
http://www.redbooks.ibm.com/abstracts/SG246193.html?Open
One of the other guys may have more spacific examples

Dave
0
 
LVL 8

Expert Comment

by:H
ID: 17018892
Lets take a step back...You mentioned you needed to retrieve some information from some non-as/400 server somewhere in the network?  Basically your trying to use the as/400 to get data from a differnt system?  Is this correct?

I can help I just need more detail on what you are trying to do.

So you mentioned setting up directory services on the as/400 .  Im betting they are already setup..

Are you trying to retrive/send a flat/text file or straight data?  
0
 
LVL 8

Expert Comment

by:H
ID: 17019063
Also can you go onto an as/400 command line and take the following steps

Command: QSYS/NETSTAT
take option# 3
Scroll until you find LDAP...Is it in a listening state?
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 17019295
Hi Experts,

I have some more information...
Some server on the net work with some information, is als o replicated to an Oracle DB
maybe it is better to uose that?????  But even then I don't know where to start.

What I want to do:
On this moment, a user is filling a file with an existing program, and copy and paste the info from a web-based application. I planned to create a new program, so that he only have to enter the key and 80% from his info is retrieved from the web based application or from the Oracle server...

Regards,
Murph
0
 
LVL 27

Expert Comment

by:tliotta
ID: 17021019
Murph:

Your network people have claimed that they can provide something that you apparently asked for. They say that they can provide it if you "can define a LDAP connection".

Taking them at their word...

...then what connection are they asking for? Connection to what? from what?

Yes, AS/400s have had both LDAP server and client facilities for a long time. But what does that have to do with what you asked them about? Are they saying that you need to run some LDAP queries against an LDAP server that they have running somewhere in your network, and you need to "define a LDAP connection" in order to do that? If so, I would assume that they mean you need to know how to run LDAP queries. You essentially have to connect to an LDAP server just like you'd have to connect to a remote SQL database. I.e., you have to "define a LDAP connection" with the ldap_open() API.

Or maybe they mean something different entirely.

It _seems_ like you want to do an LDAP query in order to find out if you should retrieve some info from the web app or you should retrieve it from Oracle; the LDAP info would tell your program where to go next.

Is that close?

Tom
0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 17021060
Tom,

I really don't know anything about LDAP or remote SQL....
after the weekend, I will ask them to explain me what they can offer me and where I can get it.

I will go for the easy solution, I dont care if it is LDAP or Oracle.....
the number of records I have to read per time is less then 50 so
the speed is not that important.

have a nice weekend.
Murph.
0
 
LVL 27

Expert Comment

by:tliotta
ID: 17021281
Murph:

It looks like hollecar will have good info for you. I stuck my nose in just to help ensure that the thread gets enough background that (1) the expert can answer and (2) it will be a useful thread for someone in the future.

It's always useful to have a clear picture of the issue.

Tom
0
 
LVL 33

Accepted Solution

by:
shalomc earned 50 total points
ID: 17026865

Here is a short ldap tool that I whipped up a couple of years ago, written in rexx (my favorite).
If performance is important to you then don't use it, there are faster rpg/c options.
you may have to tweak the search parameters a bit, not all ldap servers are the same.
go to qshell and type ldapsearch for a command synopsis.


/********* start of REXX program LDAPSEARCH **************/
/* By Shalom Carmel, 2001                                         */  
/*                                                                       */  
                                                                             
parse arg lower  'SERVER(' server  ')'                                        
parse arg lower  'FILTER(' filterq ')'                                        
parse arg lower  'BASE(' baseq   ')'                                          
parse arg lower  'VERBOSE(' verbose ')'                                      
parse arg lower  'OUTPUT(' output  ')'                                        
parse arg lower  'STMF(' stmfq   ')'                                          
                                                                             
arg command_string                                                            
parse source _system _start _srcmbr _srcfile _srclib                          
this_source='/QSYS.LIB/'_srclib'.LIB/'_srcfile'.FILE/'_srcmbr'.MBR'          
                                                                             
/*                                                                       */  
/*                                                                       */  
                                                                           
select                                                                    
  when verbose='*YES'  then vrb= '-v'                                      
  when verbose='*NO'    then vrb=''                                        
  otherwise            vrb=''                                              
end                                                                        
                                                                           
select                                                                    
  when baseq  =''      then base='base "(objectclass=person)"'            
  otherwise            interpret 'base=  '   baseq                        
end                                                                        
                                                                           
   interpret 'filter= '   filterq                                          
   redirect = ' '                                                          
   usrdta = substr(filter,1,10)                                            
                                                                           
select                                                                    
  when output ='*'     then nop                                            
  when output ='*PRINT'     then do                                        
                                   call print400 usrdta                    
                             end                                              
  when output ='*STMF '     then do                                          
                                 interpret 'stmf = '   stmfq                  
                                 redirect=' > ' stmf                          
                             end                                              
  otherwise            nop                                                    
end                                                                          
                                                                             
   ldapquery = 'ldapsearch' vrb '-h' server '-s sub'  filter        redirect  
/* say ldapquery   */                                                        
    'QSH cmd(''' ldapquery ''')'                                              
  if   output ='*PRINT'     then do                                          
   'CHGSPLFA FILE(QSYSPRT) SPLNBR(*LAST) usrdta(&usrdta)'                    
 end                                                                          
exit                                                                          
                                                                             
                                                                             
                                                                             
print400: procedure                                                          
arg usrdta                                                            
    'ovrdbf stdout tofile(qsysprt)'                                    
 return                                                                

/* Error Trapping Routine      */                                      
Error_Trap:                                                            
interpret 'signal ' end_of_op                                          
                                                                       
/********* end of REXX program LDAPSEARCH **************/


/********* start of command  LDAPSEARCH **************/
LDAPSEARCH:     CMD        PROMPT('LDAP Search')                                
                                                                             
             PARM       KWD(FILTER) TYPE(*CHAR) LEN(100) +                  
                          DFT('"CN=Bugs Bunny,OU=NY,O=Acme"') +              
                          MIN(0) CASE(*MIXED) PROMPT('Filter ')              
             PARM       KWD(SERVER) TYPE(*CHAR) LEN(30) +                    
                          DFT(LDSPTV01) MIN(0) CASE(*MIXED) +                
                          PROMPT('Server ')                                  
/*           PARM       KWD(BASE) TYPE(*CHAR) LEN(50) +                      
                          DFT('"(objectclass=person)"') MIN(0) +            
                          CASE(*MIXED) PROMPT('Base   ')    */              
             PARM       KWD(VERBOSE) TYPE(*CHAR) LEN(4) RSTD(*YES) +        
                          DFT(*YES) VALUES(*YES *NO) MIN(0) +                
                          PROMPT('Verbose')                                  
             PARM       KWD(OUTPUT) TYPE(*CHAR) LEN(6) RSTD(*YES) DFT(*) +  
                          VALUES(* *PRINT *STMF) MIN(0) +                    
                          PROMPT('Output type')                              
             PARM       KWD(STMF) TYPE(*PNAME) LEN(120) MIN(0) CASE(*MIXED) +
                          PROMPT('Stream File')                              
             DEP        CTL(&OUTPUT *EQ '*STMF') PARM((STMF)) +    
                          MSGID(CPD0071)                          
                                                                   
/********* end of command  LDAPSEARCH **************/


CRTCMD CMD(LDAPSEARCH)    
       PGM(*REXX)            
       SRCFILE(QCMDSRC)  
       REXSRCFILE(lib/QREXSRC)
       REXSRCMBR(*CMD)        
       REXCMDENV(*COMMAND)    


0
 
LVL 16

Author Comment

by:theo kouwenhoven
ID: 17042466
Hey shalomc,

Thanks for the example, I did choose the QAD way quick and dirty, and created with help of your example a QShell command
to fill a file.

QSH        CMD(&LDAPQRY)

where &LDAPQRY is

ldapsearch -b O=xxx,DC=xxxx,DC=xxx,DC=COM -h dir.mynet.com  -s sub uid=<varible>  MyNetCn MyNetDomain MyNetUsername MyNetMail
  > /QSYS.LIB/DCSFCYPH.LIB/WEBLDAP.FILE/<variable>.MBR                                                                          

It works fine for this purpose

THANKS
Murph
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
syntax to read a test file using  VBScript &  Iseries PCOMM 3 263
How to access power server P460 of ibm pureflex 1 240
JDEdwards AP Batch 4 68
IBM TS3100 tape Library 3 63
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question