XMLSERVICE Admin

1. Unzip xmlservice-rpg.zip to xmlservice.savf
2. FTP xmlservice.savf to QGPL library (empty savf must exist already)
   > crtSAVF FILE(QGPL/XMLSERVICE)
   > clrSAVF FILE(QGPL/XMLSERVICE)
3. Install XMLSERVICE source code library on IBM i
   > RSTLIB SAVLIB(XMLSERVICE) DEV(*SAVF) SAVF(QGPL/XMLSERVICE)
   Note: if updating/replacing and you get "objects not restored," try options MBROPT(*ALL) ALWOBJDIF(*ALL)   
4. Create xmlservice RPG programs in your choice of test and/or zend production libraries
   Note: choose from libraries XMLSERVICE, ZENDSVR, or CRTXMLQ (or all three).
   There's no difference. PHP users will tend to use ZENDSVR for their production library.
   PHP users, set the proper library with the XMLServiceLib key in your toolkit.ini file (default is ZENDSVR).

   Start this way: 
   > ADDLIBLE XMLSERVICE

   Then choose library/libraries to compile into:
-- compile into test version XMLSERVICE library (will NOT update zend production ZENDSVR library) ---
   > CRTCLPGM PGM(XMLSERVICE/CRTXML) SRCFILE(XMLSERVICE/QCLSRC)
   > call crtxml
-- or update zend production ZENDSVR library --
   > CRTCLPGM PGM(XMLSERVICE/CRTXML2) SRCFILE(XMLSERVICE/QCLSRC)
   > call crtxml2
-- or update QXMLSERV library (a third option, available 1.7.2+) --
   > CRTCLPGM PGM(XMLSERVICE/CRTXMLQ) SRCFILE(XMLSERVICE/QCLSRC)
   > call crtxmlq -- QXMLSERV library
   Note redistribution: 
   - ONLY redistribute RSTOBJ to same library as SAVOBJ
     or will break your toolkit different library (hang/busy)
     because various plugconf(x) are hard coded to each library 
     (crtxml, crtxml2, crtxmlq)
   - stored procedures are automatically updated
     on SAVOBJ/RSTOBJ any library via
     Program Associated Space (not need crtsql)
   - Key objects SAV/RST: 
     XMLSERVICE, XMLSTOREDP, XMLCGI, XMLMAIN
     (again do NOT SAVOBJ/RSTOBJ different libraries)     
5. Optional XMLSERVICE tests
   > CRTCLPGM PGM(XMLSERVICE/CRTTEST) SRCFILE(XMLSERVICE/QCLSRC) 
   > call crttest
-- V6+ added tests 
   > CRTCLPGM PGM(XMLSERVICE/CRTTEST6) SRCFILE(XMLSERVICE/QCLSRC) 
   > call crttest6
6. Grant *ALL rights over XMLSERVICE to users QTMHHTTP and QTMHHTP1
   > CHGAUT OBJ('/qsys.lib/XMLSERVICE.lib') USER(QTMHHTTP) DTAAUT(*RWX) OBJAUT(*ALL) SUBTREE(*ALL)
   > CHGAUT OBJ('/qsys.lib/XMLSERVICE.lib') USER(QTMHHTP1) DTAAUT(*RWX) OBJAUT(*ALL) SUBTREE(*ALL)

Notes:
- *** IMPORTANT *** 
  If running a default IBM ship machine with CCSID 65535 (hex)
  You will need to set Apache to a valid CCSID (like 37, etc.) (Zend Server example below):
  /www/zendsvr/conf/httpd.conf (web admin GUI port 2001 - ZENDSVR):
  DefaultFsCCSID 37
  CGIJobCCSID 37
-- *** IMPORTANT *** 
   When running DBCS on IBM i and see "bad character data" (Chinese characters),
   setSetEnv="CCSID=1208"; SetEnv="LANG=C" in /www/zendsvr/conf/fastcgi.conf 
- === WARNING ===
  crtxml, crtxml2 may present error, just ignore (script both update/install)
  SQLSTATE: 42704                    
  NATIVE ERROR CODE: -204
  Note to IBM i admins:
    you will not need drag crtsql when moving XMLSERVICE programs (XMLSTOREDP)
    to other systems because PGM associated space will assure up to 32 "associated"
    stored procedures come along for SAV/RST ride (many folks do not know that),
    all works because stored procs are created after PGM/SRVPGM by crtxml(2).