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 |
} |
b1a6a5
|
16 |
|
413d3b
|
17 |
//* Set the function parameters. |
T |
18 |
$client_id = 1; |
|
19 |
$params = array( |
b1a6a5
|
20 |
'server_id' => 1, |
MC |
21 |
'domain' => 'test.tld', |
|
22 |
'active' => 'y' |
|
23 |
); |
|
24 |
|
413d3b
|
25 |
$domain_id = $client->mail_domain_add($session_id, $client_id, $params); |
T |
26 |
|
|
27 |
echo "Domain ID: ".$domain_id."<br>"; |
b1a6a5
|
28 |
|
413d3b
|
29 |
if($client->logout($session_id)) { |
T |
30 |
echo 'Logged out.<br />'; |
|
31 |
} |
b1a6a5
|
32 |
|
MC |
33 |
|
413d3b
|
34 |
} catch (SoapFault $e) { |
T |
35 |
echo $client->__getLastResponse(); |
|
36 |
die('SOAP Error: '.$e->getMessage()); |
|
37 |
} |
|
38 |
|
|
39 |
?> |