Portus Version 2018-08-24
 

Get an Employee (ex04_SoaGatewayEmpGet.php)

<?php

/*
 *  The "get" operation is even easier.
 */
try{
 $soapclient = new SoapClient("http://localhost:8022/adabas_EmployeesMini?WSDL", array('trace' => 1));
} catch (SoapFault $soapfault) {
 echo "<pre>";
 print_r($soapfault);
 echo "</pre>";
}

/*
 *  Construct the "key array", which consists of just one element,
 *  the primary key for the employees file - "personnel_id";
 */
$primKey = array('personnel_id' => '99999999');

/*
 *  Get the record
 */
try {
 $Adabasresponse = $soapclient->get($primKey);
} catch (SoapFault $soapfault) { 
 echo "<pre>";
 print_r($soapfault);
 echo "</pre>";
 return;
}

/*
 *  Check if we actually got the record we are looking for
 */
if (is_null($Adabasresponse->adabasEmployees->adabasEmployee)) {
 echo "No Employee with personnel_id=".$primKey['personnel_id'];
 return;
}

/*
 *  Print the formatted response
 */
echo "<pre>";
print_r($Adabasresponse);
echo "</pre>";

/*
 *  Proceed to ex05_SoaGatewayEmpDel.php - Delete the record added in ex03_SoaGatewayEmpAdd.php 
 */
?>

Ostia
www.ostiasolutions.com
Copyright @ 2006-2018 Ostia Software Solutions Limited.