35 |
*/ |
*/ |
36 |
function postViaSOAP($msg) { |
function postViaSOAP($msg) { |
37 |
global $ARRETE_WSDL; |
global $ARRETE_WSDL; |
38 |
global $ARRETE_URL_WS; |
global $ARRETE_LOGIN; |
39 |
|
global $ARRETE_PASS; |
40 |
|
|
41 |
$data = $msg->body; |
$data = $msg->body; |
42 |
$data = json_decode($data); |
$data = json_decode($data); |
50 |
} |
} |
51 |
|
|
52 |
// Instanciation du client SOAP |
// Instanciation du client SOAP |
53 |
$soapClient = new SoapClient($ARRETE_WSDL,array("trace" => AMQP_DEBUG)); |
$soapClient = new SoapClient($ARRETE_WSDL,array('trace' => AMQP_DEBUG, |
54 |
|
'exceptions' => true, |
55 |
|
// Auth credentials for the SOAP request. |
56 |
|
'login' => $ARRETE_LOGIN, |
57 |
|
'password' => $ARRETE_PASS,)); |
58 |
|
|
59 |
|
|
60 |
$error = 0; |
$error = 0; |
61 |
|
|
65 |
// accuse de reception du message |
// accuse de reception du message |
66 |
$msg->delivery_info['channel']-> |
$msg->delivery_info['channel']-> |
67 |
basic_ack($msg->delivery_info['delivery_tag']); |
basic_ack($msg->delivery_info['delivery_tag']); |
68 |
|
|
69 |
|
logger::instance()->cleanLog(); |
70 |
|
logger::instance()->log("Message envoye", EXTRA_VERBOSE_MODE); |
71 |
|
logger::instance()->writeLogToFile(); |
72 |
} catch (SoapFault $fault) { |
} catch (SoapFault $fault) { |
73 |
// Gestion d'erreurs |
// Gestion d'erreurs |
74 |
$error = 1; |
$error = 1; |
96 |
// $info->ws_DA_Out_N_Doss_ADS |
// $info->ws_DA_Out_N_Doss_ADS |
97 |
} |
} |
98 |
|
|
99 |
|
// pour des besoins de log il faut set $_SERVER["REQUEST_URI"] |
100 |
|
if (!isset($_SERVER["REQUEST_URI"])) { |
101 |
|
$_SERVER["REQUEST_URI"] = __FILE__; |
102 |
|
} |
103 |
|
|
104 |
// si le $argv[1] manque on ne peut pas cree un tag unique pour le |
// si le $argv[1] manque on ne peut pas cree un tag unique pour le |
105 |
// consumeur et dans ce cas-la on termine l'execution |
// consumeur et dans ce cas-la on termine l'execution |
106 |
$suffix = ''; |
$suffix = ''; |