Starting HTTP servers with different library lists - Support

Starting HTTP servers with different library lists

From Support

Jump to: navigation, search

Listed below is a Midrange Press Newsgroup Item on changing library lists on the AS/400 - iSeries Web Server

Starting HTTP servers with different library lists I've been trying for ages to find out how to start a testing HTTP server with a different library list to our live HTTP server. Here's how: Do a WRKSBS on sub-system QHTTPSVR. Display routing entries - you'll see there's one routing entry there already, with a compare value of 'HTTPWWW', and program specified is QCMD in library QSYS. You can add another routing entry to this subsystem with the ADDRTGE command. e.g.

ADDRTGE SBSD(QHTTPSVR/QHTTPSVR) SEQNBR(1) CMPVAL(*ANY) PGM(YOURLIB/YOURPGM) CLS(QHTTPSVR/QZHBHTTP)

Once this is done, whenever any job starts in the QHTTPSVR subsystem, program YOURPGM in library YOURLIB gets called. You'll need to write this program yourself, and it's here you get the chance to change the library list. Here's an outline of the CL program I'm using to change the library list for HTTP server job 'TESTING', leaving the library list as it is for any other HTTP server:

            PGM                                                       
            DCL        VAR(&JOB) TYPE(*CHAR) LEN(10)                               RTVJOBA    JOB(&JOB)                                      
            IF         COND(&JOB *EQ 'TESTING') THEN(DO) 
            CHGLIBL    LIBL(LIB1 LIB2 LIB3 LIB3) 
            MONMSG     MSGID(CPF0000)                                 
            ENDDO                                                                  TFRCTL     PGM(QCMD)                                                   ENDPGM    


Changing Library List from java Program We use a different technique. Every time we need something from the 400 in our server process, after we open the connection, we use command.run("CHGLIBL (PRDDTA PRDPGM QGPL QTEMP)"); inside the java class that needs data. The library list is usually set in some parameter file so we can change it for whichever process needs a different list.

Personal tools