Toolkit Service Program Call Issue

The place for general PHP questions and hints for PHP on IBM i
Post Reply
jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Toolkit Service Program Call Issue

Post by jord1322 » Mon Nov 03, 2014 3:56 pm

Hello,
I'm trying to run a Service Program call in the PHP Toolkit. The RPG program is set to receive one value and then return another based on the received value. I have the below code, and while I'm not getting any errors, the output is not returning any values as it should be. I'm not sure if I'm missing something or setting something up wrong. I've use the provided demos and a former successful programs call (not a service program call with a function name) to derive this one, but it just does not seem to be working in the end. Any help would be appreciated. I'm not sure what I'm missing at this point.

$vendorNumber = trim($resultVendor[0]['VDNUMB']); //Input variable
$vendorName = ' ';

$paramVend = $ToolkitServiceObj->AddParameterChar('in', 5, 'Vendor #', 'VENDOR', $vendorNumber); //Input parameter
$output = $ToolkitServiceObj->AddParameterChar('out', 30, 'Vendor Name', 'VNAME', $vendorName); //Output parameter

$OutputParamsVend = $ToolkitServiceObj->PgmCall('SVCPRG', "LIBRARY", $paramVend, $output, array('func'=>'aplvndname') );

if( isset($OutputParamsVend['io_param']['VENDOR'])){
echo " Vendor #:".$vendorNumber." = ".$OutputParamsVend['io_param']['VNAME'];
} else {
echo " Operation failed. Vendor # $vendorNumber did not retrieve.";
};

scottgcampbell
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada

Re: Toolkit Service Program Call Issue

Post by scottgcampbell » Mon Nov 03, 2014 4:22 pm

Can you turn on debug and see what the output is?

$ToolkitServiceObj->setToolkitServiceParams(array('debug'=>true));

Check the toolkit.ini to see where the debug log will default to.

Once you have that let us know what it has in it, you should also be able to debug and step into ToolkitService.php to see what it is doing and make sure it is getting to the call.

Scott

jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Re: Toolkit Service Program Call Issue

Post by jord1322 » Mon Nov 03, 2014 5:27 pm

Thanks. There are several errors showing though I'm not sure what they mean. Here is the piece from the debug log:

Code: Select all

Exec start: 2014-11-03 11:23:45
Version of toolkit front end: 1.5.0
IPC: '/tmp/JGREENE'. Control key: *cdata *sbmjob(ZENDSVR6/ZSVR_JOBD/XTOOLKIT)
Stmt: call ZENDSVR6.iPLUG32K(?,?,?,?) with transport: ibm_db2
Input XML: <?xml version="1.0" encoding="ISO-8859-1" ?>
<script>
<pgm name='APS990' lib='SHOES' func='aplvndname'>
<parm comment='Vendor #'><data var='Vendor' type='5A'>R0480</data></parm>
<parm comment='Vendor Name'><data var='Name' type='30A'> </data></parm>
</pgm>
</script>
Output XML: <?xml version="1.0" encoding="ISO-8859-1" ?>
<report>
<version>XML Toolkit 1.9.1</version>
<error>
<errnoxml>1100004</errnoxml>
<xmlerrmsg><![CDATA[XML run loop failed]]></xmlerrmsg>
<xmlhint><![CDATA[p(54) <pgm name='APS990' lib='SHOES' func='aplvndname']]></xmlhint>
</error>
<error>
<errnoxml>1000008</errnoxml>
<xmlerrmsg><![CDATA[ILESYM failed]]></xmlerrmsg>
<xmlhint><![CDATA[aplvndname]]></xmlhint>
</error>
<error>
<errnoxml>1100016</errnoxml>
<xmlerrmsg><![CDATA[XML run pgm failed]]></xmlerrmsg>
<xmlhint><![CDATA[<pgm name='APS990' lib='SHOES' func='aplvndname'>
<parm com]]></xmlhint>
</error>
<error>
<errnoxml>1100004</errnoxml>
<xmlerrmsg><![CDATA[XML run loop failed]]></xmlerrmsg>
<xmlhint><![CDATA[p(54) <pgm name='APS990' lib='SHOES' func='aplvndname']]></xmlhint>
</error>
<xmloutput><![CDATA[<?xml version="1.0" encoding="ISO-8859-1" ?>
<script>
<pgm name='APS990' lib='SHOES' func='aplvndname'>
</pgm>
]]></xmloutput>
<jobinfo>
<jobipc>/tmp/JGREENE</jobipc>
<jobipcskey>010BADF4</jobipcskey>
<jobname>XTOOLKIT</jobname>
<jobuser>JGREENE</jobuser>
<jobnbr>858091</jobnbr>
<jobsts>*ACTIVE</jobsts>
<curuser>JGREENE</curuser>
<ccsid>37</ccsid>
<dftccsid>37</dftccsid>
<paseccsid>819</paseccsid>
<langid>ENU</langid>
<cntryid>US</cntryid>
<sbsname>ZENDSVR6</sbsname>
<sbslib>ZENDSVR6</sbslib>
<curlib>SHOES</curlib>
<syslibl>QSYS QSYS2 QHLPSYS QUSRSYS</syslibl>
<usrlibl>QTEMP QGDDM QGPL SHOES QS36F</usrlibl>
<jobcpffind>see log scan, not error list</jobcpffind>
</jobinfo>
<joblog job='XTOOLKIT' user='JGREENE' nbr='858091'>
<![CDATA[failure]]>
</joblog>
</report>

Exec end: 2014-11-03 11:23:45. Seconds to execute: 0.072069883346558.

scottgcampbell
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada

Re: Toolkit Service Program Call Issue

Post by scottgcampbell » Mon Nov 03, 2014 6:00 pm

Looking at the errors it looks like it has an ILESYM failed, I took a quick look through the code and that is in PLUGPASE and possibly occurs when the called procedure isn't exported???? Hopefully Alan or Tony will see this thread and answer for sure but you could check that to be sure it isn't the issue.

Scott

jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Re: Toolkit Service Program Call Issue

Post by jord1322 » Tue Nov 04, 2014 2:09 pm

I sent the question to Alan as well. He is helping. Thanks, he is going in the same direction you were.

jord1322
Posts: 36
Joined: Mon Nov 03, 2014 3:49 pm
Location: Concord, North Carolina

Re: Toolkit Service Program Call Issue

Post by jord1322 » Tue Nov 04, 2014 5:31 pm

Fixed! My procedure call was supposed to be all capital letters. I also was only using one input parameter, so I mistakenly placed the parameter in a string instead of an array, it needed to be in an array variable to work. Now it works great. Thanks for the help!

Jordon

soch5574
Posts: 1
Joined: Wed Mar 11, 2015 5:30 am

Re: Toolkit Service Program Call Issue

Post by soch5574 » Wed Mar 11, 2015 5:31 am

I took a quick look through the code and that is in PLUGPASE and possibly occurs when the called procedure isn't exported???? Hopefully Alan or Tony will see this thread and answer for sure but you could check that to be sure it isn't the issue...???

_______________
GUL

Post Reply