commit | author | age
|
413d3b
|
1 |
<?php |
T |
2 |
|
b1a6a5
|
3 |
require 'soap_config.php'; |
413d3b
|
4 |
|
T |
5 |
|
|
6 |
$client = new SoapClient(null, array('location' => $soap_location, |
b1a6a5
|
7 |
'uri' => $soap_uri, |
MC |
8 |
'trace' => 1, |
|
9 |
'exceptions' => 1)); |
413d3b
|
10 |
|
T |
11 |
|
|
12 |
try { |
b1a6a5
|
13 |
if($session_id = $client->login($username, $password)) { |
413d3b
|
14 |
echo 'Logged successfull. Session ID:'.$session_id.'<br />'; |
T |
15 |
} |
|
16 |
|
|
17 |
//* Parameters |
|
18 |
$reseller_id = 1; |
7b47c0
|
19 |
$client_id = 1; |
413d3b
|
20 |
|
T |
21 |
|
|
22 |
//* Get the client record |
7b47c0
|
23 |
$client_record = $client->client_get($session_id, $client_id); |
413d3b
|
24 |
|
T |
25 |
//* Change parameters |
|
26 |
$client_record['country'] = 'de'; |
|
27 |
$client_record['username'] = 'mguy'; |
|
28 |
$client_record['contact_name'] = 'brush'; |
b1a6a5
|
29 |
|
7b47c0
|
30 |
//* We set the client password to a empty string as we do not want to change it. |
T |
31 |
$client_record['password'] = ''; |
b1a6a5
|
32 |
|
413d3b
|
33 |
$affected_rows = $client->client_update($session_id, $c_id, $reseller_id, $client_record); |
T |
34 |
|
|
35 |
echo "Number of records that have been changed in the database: ".$affected_rows."<br>"; |
b1a6a5
|
36 |
|
413d3b
|
37 |
if($client->logout($session_id)) { |
T |
38 |
echo 'Logged out.<br />'; |
|
39 |
} |
b1a6a5
|
40 |
|
MC |
41 |
|
413d3b
|
42 |
} catch (SoapFault $e) { |
T |
43 |
echo $client->__getLastResponse(); |
|
44 |
die('SOAP Error: '.$e->getMessage()); |
|
45 |
} |
|
46 |
|
|
47 |
?> |