<?php
require dirname(__FILE__) . '/../../autoload.php';

// Init du service
$service = new \SparkWebService(array('cache_wsdl' => WSDL_CACHE_NONE));

$token = 'test-467afe5eff145ffb2d87';

// Méthode UpdateClient 
// Init des paramètres

$date = new DateTime();
$dateFormat = $date->format('Ymd');
$publicKey = md5(uniqid('SparkWeb'));

$key = $token . $publicKey .  $dateFormat;
$hashkey = md5($key);



$ClientId = "90000018";
$WebClientId = "WEB-CLIENT-02";
$Civility = "1";
$FirstName = "Nicolas";
$LastName = "Martin";
$BirthDate = $date;
$LastUpdate = $date;
$WebCreationDate = $date;
$SiretNumber = 'Web siret2';
$IntraComVat = 'Web intracomvat2';
$IsInactive = '0';
$AddressLine1 = "AddressLine1";	
$AddressLine2 = "AddressLine2";	
$Building = "Building";		
$PostalCode = "75000";		
$City = "Paris";		
$Country = "FR";		
$PhoneNumber = "0606060606";	

// Appel de la requête
$request = new \UpdateClient($hashkey,$publicKey,$ClientId, $WebClientId, $Civility, $FirstName, $LastName, $BirthDate, $LastUpdate, $WebCreationDate, $SiretNumber, $IntraComVat,$AddressLine1, $AddressLine2, $Building, $PostalCode, $City, $Country, $PhoneNumber);

// Récupération de la réponse
$response = $service->UpdateClient($request);
var_dump($response);