This tutorial
Demonstrates how to access SOA Gateway from a PHP script
Provides a number of PHP examples.
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.
The PHP interpreter is available as source code or as pre-compiled binaries for major platforms, including most Linux™ distributions, Windows®, Mac OS X, and iSeries™.
The latest release is PHP 5 and is seeing increasing adoption. PHP 5 introduces improvements to the object model; also, the underlying memory management has been redesigned with multi-threading and performance in mind.
For more information about PHP, or to download the software, please refer to the PHP homepage.
New in PHP 5 is a built-in SOAP extension. It is supplied as part of PHP.
For this tutorial to work, you should have PHP 5 up and running in your Web server, see the install.txt document in the PHP distribution library for details.
The Eclipse PHP Development Tools (PDT) are not absolutely necessary, but using Eclipse greatly simplifies the development process. This tutorial assumes the PDT to be installed.
Please refer to the Eclipse PDT project pages for installation and configuration instructions.
First, create a new project within your workspace.
Opt to create a PHP Project, click
Give the project a name and unselect the "Use default" box. Browse to the default location of your html documents, in this case an Apache server document folder called "ASGdocs", click
If you are asked to switch to the PHP perspective, opt to do so
Create the PHP SOAP client
Create a PHP script file by right-clicking into the Eclipse Navigator area, select
->Specify a File name, click
Opt to create a "Simple PHP File"
The PHP SOAP class to represent the Adabas Service is called SoapClient, the first step will be to instantiate SoapClient, passing the URL of an SOA Gateway WSDL as the parameter:
Now that we have instantiated our client we want to see what methods it provides and what parameters are required. Fortunately we can get PHP and the instantiated SoapClient class to do most of the work for us easily:
If you run this as a console application (via "Run") the output is much better formatted than running it in the PHP browser. The console window will show the following:
This shows that the service described by the WSDL provides five operations: list, get, delete, add and update; It also lists the required parameters and the responses given.
A description of the input and output parameters can be retrieve by calling the __getTypes class:
The output will look like this:
This information is sufficient to construct the first simple call to the "list" operation.
First an array of the required input parameters needs to be constructed:
Ready to invoke the "list" operation as a method of the soapclient class:
Now it is just a matter of taking the returned object and outputting the required results in a table:
Run this in the built in PHP Browser (activated with "
" -> " " and select " ") or an external browser: http://<your_localhost_url>/PHPempMini.php:The following PHP examples can be copied from here, moved to your web server's DocumentRoot (for example) and executed: