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

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


$token = 'test';
// Méthode Createclient 
// Init des paramètres

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

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

$WebClientId = "WEB-CLIENT-05";
$Email = "web-email@email.fr";
$Civility = "1";
$FirstName = "Robin";
$LastName = "Delage";
$BirthDate = $date;
$LastUpdate = $date;
$WebCreationDate = $date;
$SiretNumber = '1212121212';
$IntraComVat = '1010101010';
$AddressLine1 = "AddressLine1";	
$AddressLine2 = "AddressLine2";	
$Building = "Building";		
$PostalCode = "75000";		
$City = "Paris";		
$Country = "FR";		
$PhoneNumber = "0606060606";	



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

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