extranet/includes/giant/modulesGiants/SwitchFunctionSoap.php

51 lines
1.2 KiB
PHP
Raw Normal View History

<?php
2011-04-06 13:13:14 +00:00
/**
* Fonction de switche entre les méthodes de Giant.
*
* @param $name
* @param $structure
* @param $soap_client
*/
function SwitchWSDLFunction($name, &$structure, &$soap_client)
{
$CatchError = new SOAPCatchError();
try {
switch ($name)
{
case 'Search':
return ($soap_client->Search($structure));
break;
case 'AdvancedSearch':
return ($soap_client->AdvancedSearch($structure));
break;
case 'RetrieveOptions':
$soap_client->RetrieveOptions($structure);
break;
case 'OrderDataSet':
return ($soap_client->OrderDataSet($structure));
break;
case 'RetrieveDataSet':
return ($soap_client->RetrieveDataSet($structure));
break;
case 'Ping':
return ($soap_client->Ping($structure));
break;
default:
return (EXIT_FAILURE);
}
} catch (SoapFault $fault) {
$CatchError->_printInLogs($fault->detail);
if(_DEBUG_MODE_)
{
echo '<b>__getLastRequest return : </b><br /><xmp>';
echo $soap_client->__getLastRequest().'</xmp>';
echo '<br /><b>__getLastResponse return : </b><br /><xmp>';
echo $soap_client->__getLastResponse().'</xmp>';
}
else
echo $CatchError->_getMessage();
exit;
}
}
?>