From YiPs Wiki (i powered)

XMLService: XMLSERVICE Just Toolkit

(click to open)

Quick Page Table of Contents

Scanning…

Zend PHP Toolkit

Goto Main Page
Goto Documents

Who is this page for?

Instructions designed for IBM i developer learning PHP starting from ground zero …

Prerequisites

On IBM i …

On laptop DRDA or ODBC …

1) Install PHP on your PC/laptop

Download Zend Server …

Download PHP toolkit and CW …
{Goto Main Page} and {Download Latest} version of cw-php-x.x.x.zip PHP framework. This zip file contains all the PHP code required to use the new toolkit from your laptop (your DB2 Connect).

Follow the instructions below to install the php code (Linux, but Windows similar) …

cd /usr/local/zend/share
sudo unzip cw-php-1.1.2.zip
sudo mkdir ToolkitApi
sudo mv ToolkitApi.zip ToolkitApi/.
sudo unzip ToolkitApi.zip
sudo gedit php.ini &
; UNIX: "/path1:/path2"
include_path = ".:/usr/local/zend/share/ToolkitApi:/usr/local/zend/share/ZendFramework/library:/usr/local/zend/share/pear"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"

Note: If you are using the IBM i PTFS for XMLSERVICE change toolkit.ini: XMLServiceLib = “QXMLSERV”. Also check the lugconnect PHP script and change XMLSERVICE library to QXMLSERV as needed.

Run ibm_db2 to IBM i

Need some tests to try (a few include with XMLSERVICE) …

5250
> ADDLIBLE XMLSERVICE
> CRTCLPGM PGM(XMLSERVICE/CRTTEST) SRCFILE(XMLSERVICE/QCLSRC) 
> call crttest

Step 2) Configuration

Step 3) Example - PGM complex data with DS

Example calling a typical IBM i functions with a few parameters.

How to select odbc or ibm_db2 (laptop)?

//The ToolkitService connection method/function uses either IBM_DB2(default)or ODBC extensions to connect
//to IBM i server. In order to switch to ODBC connection assign an "odbc' value to the $extension varibale
//and make sure that the ODBC extension is enabled in the PHP.INI file. 
$extension='ibm_db2'; 
try {
    $ToolkitServiceObj = ToolkitService::getInstance($db, $user, $pass, $extension);
    }

    catch (Exception $e)
    {             
        echo  $e->getMessage(), "\n";
        exit();
    }

If you would like additional information on ibm_db2/ODBC connections to XMLSERVICE try these links.

Step 4) Disconnect

How you choose to run your toolkit will greatly affect the overall performance.


Author(s)

Tony “Ranger” Cairns - IBM i PHP / PASE

Retrieved from http://youngiprofessionals.com/wiki/index.php/XMLService/XMLSERVICEJustToolkit
Page last modified on October 18, 2013, at 01:36 PM EST