2010-10-06 11:47:31 +00:00
|
|
|
<?php
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
// getProviderId
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
function getProviderId($pays)
|
|
|
|
{
|
|
|
|
switch ($pays) {
|
2010-10-08 12:31:59 +00:00
|
|
|
case 'BE': return '001';
|
|
|
|
case 'NL': return '003';
|
2010-10-06 11:47:31 +00:00
|
|
|
default:
|
|
|
|
print 'Erreur sur le pays';
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
// getClient
|
|
|
|
// --------------------------------------------------------------------------- //
|
|
|
|
function getClient($pays, $service)
|
|
|
|
{
|
|
|
|
$service_header = new StdClass;
|
|
|
|
$service_header->ConsumerId = '006';
|
|
|
|
$service_header->Provider = new StdClass;
|
2010-10-08 12:31:59 +00:00
|
|
|
$service_header->Provider->CountryCode = $pays;
|
2010-10-06 11:47:31 +00:00
|
|
|
$service_header->Provider->ProviderId = getProviderId($pays);
|
|
|
|
$service_header->TimeStamp = date('Y-m-d\TH:i:s');
|
|
|
|
$service_header->TestIndication = true;
|
|
|
|
|
|
|
|
$soap_header =
|
|
|
|
new SoapHeader('http://services.giant-net.com/'.
|
|
|
|
'schema/services/shared/1.0',
|
|
|
|
'ServiceHeader', $service_header);
|
|
|
|
$soap_client =
|
|
|
|
new SoapClient('https://giant-tst.graydon.nl/'.$service.'/v1?wsdl',
|
|
|
|
array('soap_version' => SOAP_1_1,
|
|
|
|
'login' => '006',
|
|
|
|
'password' => 'ClaudeMonet',
|
|
|
|
'trace' => true));
|
|
|
|
$soap_client->__setSoapHeaders($soap_header);
|
|
|
|
|
|
|
|
return $soap_client;
|
|
|
|
}
|
|
|
|
?>
|