Code:
-
-
- /*=============================================================================================
- /* Notes
- /*=============================================================================================
-
- /* Compile with ACTGRP(TESTRC)
-
- /*=============================================================================================
- /* Control Specifications
- /*=============================================================================================
-
- H Option(*NODEBUGIO)
- H ExtBinInt
- H BndDir('MCSERV')
-
-
- /*=============================================================================================
- /* File Specifications
- /*=============================================================================================
-
- FUTPMODE IF E Disk UsrOpn
-
- /*=============================================================================================
- /* Prototype Specifications
- /*=============================================================================================
-
-
-
- D testaccc2...
- D PR ExtPgm('TESTACCC2')
-
- D setAcctCodesInRevChain...
- D PR N ExtProc(*JAVA :
- D 'com.paetec.oss.accm.+
- D AcctCodeChangesInterface' :
- D 'setAcctCodesInRevChain')
- D O Class(*JAVA : 'java.lang.String') Customer Number
- D Const
- D 10I 0 Value Account Code Length
- D 20I 0 Dim(132000) Account Code(s)
- D Options(*VARSIZE)
- D Const
- D O Class(*JAVA : 'java.lang.String') Name(s)
- D Dim(132000)
- D Options(*VARSIZE)
- D Const
- D O Class(*JAVA : 'java.lang.String') Department(s)
- D Dim(132000)
- D Options(*VARSIZE)
- D Const
- D O Class(*JAVA : 'java.lang.String') Region(s)
- D Dim(132000)
- D Options(*VARSIZE)
- D Const
-
- D bindInterface...
- D PR O ExtProc(*JAVA :
- D 'com.paetec.oss.accm.+
- D AcctCodeChanges+
- D ServiceHelper' :
- D 'bind')
- D Class(*JAVA :
- D 'com.paetec.oss.accm.+
- D AcctCodeChangesInterface')
- D Static
- D O Class(*JAVA : 'java.lang.String') URL
- D Const
-
- D constructJString...
- D PR O ExtProc(*JAVA :
- D 'java.lang.String' :
- D *CONSTRUCTOR)
- D 1048576A Varying
- D Const
-
- D jStringToRString...
- D PR 1048576A ExtProc(*JAVA :
- D 'java.lang.String' :
- D 'getBytes')
- D Varying
-
-
- /*=============================================================================================
- /* Data Specifications
- /*=============================================================================================
-
- /Include QRpgCbSrc,DQUsec
- /Include QRpgCbSrc,DQMhSndPm
- /Include QRpgCbSrc,DUserCh
-
- /Include QRpgCbSrc,UNISTD.H
- /Include QRpgCbSrc,SVS9990
- /Include QRpgCbSrc,SVS9998
- /Include QRpgCbSrc,SVS9999
-
- /*---------------------------------------------------------------------------------------------
- /* Data Structure Specifications
- /*---------------------------------------------------------------------------------------------
-
- D classPaths DS LikeDs(JVMClassPathsTemplate)
- D properties DS LikeDs(JVMPropertiesTemplate)
-
- /*---------------------------------------------------------------------------------------------
- /* Array Specifications
- /*---------------------------------------------------------------------------------------------
-
-
- /*---------------------------------------------------------------------------------------------
- /* Indicator Specifications
- /*---------------------------------------------------------------------------------------------
-
- D globalInit S N
-
- /*---------------------------------------------------------------------------------------------
- /* Display Indicator Specifications
- /*---------------------------------------------------------------------------------------------
-
-
- /*---------------------------------------------------------------------------------------------
- /* Standalone Data Specifications
- /*---------------------------------------------------------------------------------------------
-
- D x S 10I 0
- D count S 10I 0
- D message S 128A Varying
- D applicationDir S 50A Varying
- D Inz('/Applications/')
- D root S 10A Varying
-
- D custAcctNum S O Class(*JAVA : 'java.lang.String')
- D acctCodeLength S 10I 0
- D acctCodes S 20I 0 Dim(132000)
- D acctCodeNames S O Class(*JAVA : 'java.lang.String')
- D Dim(132000)
- D acctCodeDepts S O Class(*JAVA : 'java.lang.String')
- D Dim(132000)
- D acctCodeRegions...
- D S O Class(*JAVA : 'java.lang.String')
- D Dim(132000)
- D response S N
- D interface S O Class(*JAVA :
- D 'com.paetec.oss.accm.+
- D AcctCodeChangesInterface')
-
- D url S O Class(*JAVA : 'java.lang.String')
-
- /*---------------------------------------------------------------------------------------------
- /* Constant Specifications
- /*---------------------------------------------------------------------------------------------
-
-
- /*=============================================================================================
- /* Program *Entry
- /*=============================================================================================
-
- D testaccc2...
- D PI
-
- /*=============================================================================================
- /* MainLine
- /*=============================================================================================
-
- /Free
-
- ExSr initialize;
-
- custAcctNum = constructJString('4362642');
-
- acctCodeLength = 11;
-
- //load the arrays.
- For x = 1 to 3;
- acctCodes(x) = x;
-
- acctCodeNames(x) = constructJString('Tim ' + %Char(x));
-
- acctCodeDepts(x) = constructJString('1');
-
- acctCodeRegions(x) = constructJString('1');
- EndFor;
-
- url = ConstructJString('http://uxra120.paetec.com:+
- 6230/WebService/AcctCodeChangesService.wsdl');
-
- interface = bindInterface(url);
-
- response = setAcctCodesInRevChain(interface :
- custAcctNum :
- acctCodeLength :
- acctCodes :
- acctCodeNames :
- acctCodeDepts :
- acctCodeRegions);
-
-
- freeLocalJReference(custAcctNum);
-
- For x = 1 to 3;
-
- freeLocalJReference(acctCodeNames(x));
-
- freeLocalJReference(acctCodeDepts(x));
-
- freeLocalJReference(acctCodeRegions(x));
- EndFor;
-
- freeLocalJReference(interface);
- freeLocalJReference(url);
-
- ExSr ExitProcedure;
-
-
- //===========================================================================================
- // Initialize Directory Root
- //===========================================================================================
-
- BegSr initializeRoot;
-
- If Not %Open(UTPMODE);
- Open UTPMODE;
- EndIf;
-
- Read UTPMODE;
-
- Close UTPMODE;
-
- Select;
-
- When BLMODE = 'PRD';
- applicationDir += 'PRD/RevChainAccountCodes/';
- root = '/Prod';
-
- When BLMODE = 'TRN';
- applicationDir += 'TRN/RevChainAccountCodes/';
- root = '/TRN';
-
- When BLMODE = 'TQA';
- applicationDir += 'TQA/RevChainAccountCodes/';
- root = '/TQA';
-
- When BLMODE = 'DEV';
- applicationDir += 'TST/RevChainAccountCodes/';
- root = '/Test';
-
- EndSl;
-
- EndSr;
- //===========================================================================================
- // Initilizing Subroutine
- //===========================================================================================
-
- BegSr initialize;
-
- If Not globalInit;
- globalInit = *ON;
- sndPm_Data_Length = 500;
- usec_Data_Length = 500;
-
- /Include QRpgCbSrc,ZQUsec
- /Include QRpgCbSrc,ZQMhSndPm
- /Include QRpgCbSrc,ZUserCh
-
- ExSr initializeRoot;
- EndIf;
-
- If setJmp(jumpPoint) = 1;
- ExSr exitProcedure;
- Return;
- EndIf;
-
- sndPM_Msg_Type = '*ESCAPE';
-
- userCHConditionHandler = %PAddr('USERCONDITIONHANDLER001');
- registerConditionHandler(userCHConditionHandler : userCHBase : *OMIT);
-
- userCH.errorBase = usec_Base;
-
- // Change Current Directory to Application Directory
- If chdir(applicationDir) < 0;
- errNoTrap(errNo() : 'chdir(' + applicationDir + ')');
- EndIf;
-
- // Start JVM
- ClassPaths.Path(1) = applicationDir;
- ClassPaths.Path(2) = applicationDir + 'GLUE-ALL.jar';
- ClassPaths.Path(3) = applicationDir + 'WebService.jar';
-
- ClassPaths.Count = 3;
-
- //properties.Property(1) = 'app=BridgeXmlClient';
- //properties.Property(2) = 'runtime.properties.impl=com.paetec.+
- // properties.FileRuntimePropertiesImpl';
- //properties.Property(3) = 'runtime.properties.file.path=+
- // config/runtime.properties';
-
- properties.Count = 0;
-
- startJVM(JVMVersion6_64 :
- ClassPaths :
- properties :
- applicationDir +
- 'Logs/stdout-' + %Char(%Timestamp()) + '.txt' :
- applicationDir +
- 'Logs/stderr-' + %Char(%Timestamp()) + '.txt' :
- *ON);
-
- EndSr;
-
- //===========================================================================================
- // Exit Procedure
- //===========================================================================================
-
- BegSr ExitProcedure;
-
- unRegisterConditionHandler(userCHConditionHandler : *OMIT);
-
- *INLR = *ON;
- Return;
-
- EndSr;
-
- /End-Free
-
- /*=============================================================================================
-
|
|