Slides from today’s talk on leveraging RPG with the PHP Toolkit and XMLSERVICE

I’ve posted the updated slides from a talk I just presented about the PHP for IBM i Toolkit. The talk was given at a free virtual conference presented by the COMMON user group and was sponsored by BCD.

The slides are available on my “past presentations” page.

I’d like to hear how you are using the toolkit. Post comments here.

Determining the proper procedure name in toolkit calls

Exact name is required when calling a service program’s procedure

Some developers make a common mistake when calling a procedure in a service program using the PHP Toolkit for IBM i or any toolkit based on XMLSERVICE. It’s easy to supply the wrong procedure name, or the right name in the wrong case (upper/lower/mixed). Using this example of calling a procedure using the toolkit, we find the following (correct) program/procedure call:

$result = $conn->PgmCall('MYPGM', 'MYLIB', $params, $retParam, 
                         array('func'=>'myproc'));

The procedure name ‘myproc’ must be given exactly as it is, not ‘MYPROC’ or ‘MyProc’, because under some circumstances the name may be case-sensitive.

How to determine the correct procedure name

Run the DSPSRVPGM command, using your desired library and program names as parameters:

DSPSRVPGM SRVPGM(MYLIB/MYPGM) DETAIL(*PROCEXP)

The above command will return service program information, including the names of all procedure exports. For example:

        Display Service Program Information                       
                                                    
Service program  . . . . . . . . . . . . :   MYPGM                           
  Library  . . . . . . . . . . . . . . . :     MYLIB                          
Owner  . . . . . . . . . . . . . . . . . :   PROGRAMMER                        
Service program attribute  . . . . . . . :   RPGLE                             
Detail . . . . . . . . . . . . . . . . . :   *PROCEXP                          
                                                                               
                              Procedure Exports:                               
                                                                               
Procedure Name                                       ARGOPT 
myproc                                               *NO    
orderHeader                                          *NO

This service program contains two procedures: ‘myproc’ and ‘orderHeader’. Thus, to call the former, we’d supply array(‘func’=>’myproc’) in the PgmCall method. If we wanted to call the second procedure, we’d use array(‘func’=>’orderHeader’), observing case sensitivity, which often matters (a topic for another day).

PHP performance webinar, June 11, 2015

Update: a recording of the webinar is available to all registrants. See the link below to register.

——–

I’ll be presenting a free webinar, “How to ensure speedy PHP applications on IBM i,” on Thursday, June 11, 2015, at 1pm Eastern/New York time. The webinar is sponsored by BCD. Registration and more information: http://www.bcdsoftware.com/bcdtracks/webinars/ondemand/php-performance-alan.htm

“Our process now runs 30-50% faster, thanks to one tip from Alan’s presentation.”
— Mike Meszaros, Software Developer, Specialty Pipe & Tube