1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| <?php
// première étape : désactiver le cache lors de la phase de test
ini_set("soap.wsdl_cache_enabled", "0");
require_once($_SERVER['DOCUMENT_ROOT'].'/lib/properties-2005-11-29/Properties.php');
// Recup des objets du contexte
$properties = NULL;
if ($GLOGALS['properties'] == NULL){
$properties = new Properties();
$properties->load(file_get_contents($_SERVER['DOCUMENT_ROOT'].'/webServices.properties'));
$GLOGALS['properties'] = serialize($properties);
}
else{
$properties = unserialize($GLOGALS['properties']);
}
define('LOG4PHP_DIR', $_SERVER['DOCUMENT_ROOT'].'/lib/log4php');
define('LOG4PHP_CONFIGURATION', $_SERVER['DOCUMENT_ROOT'].'/logg.properties');
include_once(LOG4PHP_DIR . '/LoggerManager.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/lib/hotel/logg.class.php');
// ACTION WS
$sbWsdl = $properties->getProperty('hotel.webServices.hotel.wsdl');
$sbClassmap = array();
$tmpClient = new SoapClient($sbWsdl,Array( 'trace' => 1,
'login' => "xxx",
'password' => "xxx",
'trace' => 1,
'exceptions' => 0));
foreach($tmpClient->__getTypes() as $type){
$array = split(" ", $type);
if($array[0] == "struct" && class_exists($array[1])) {
$classmap[$array[1]] = $array[1];
}
}
unset($tmpClient);
$sbOptions = Array( 'trace' => 1,
'classmap' => $sbClassmap,
'login' => "xxx",
'password' => "xxx",
'trace' => 1,
'exceptions' => 0);
?> |
Partager