
13th December 2011, 18:39
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,066
Thanks: 697
Thanked 4,246 Times in 3,259 Posts
|
|
Just as addition to cbj4074's detailed explanations, there is also a ready to use example script available in the ISPConfig 3.0.4.1 tar.gz:
/remoting_client/examples/client_add.php
|
|
The Following User Says Thank You to till For This Useful Post:
|
Typhon (13th December 2011)
|

15th January 2012, 14:05
|
|
Member
|
|
Join Date: Dec 2011
Posts: 46
Thanks: 16
Thanked 2 Times in 1 Post
|
|
I’ve tried many things but it doesn’t work, i have this error :
Quote:
|
login_failedThe login failed. Username or password wrong. SOAP Error: The login failed. Username or password wrong.
|
For this code :
PHP Code:
<?php
$username = 'admin';
$password = ‘xxxxxxxxxxxxxxxxxx';
/*
$soap_location = 'http://localhost:8080/ispconfig3/interface/web/remote/index.php';
$soap_uri = 'http://localhost:8080/interface/web/remote/';
*/
$soap_location = 'https://s1.domaine:8080/remote/index.php';
$soap_uri = 'https://s1.domaine.com:8080/remote/';
$client = new SoapClient(null, array('location' => $soap_location,
'uri' => $soap_uri,
'trace' => 1,
'exceptions' => 1));
try {
if($session_id = $client->login($username,$password)) {
echo 'Logged successfull. Session ID:'.$session_id.'<br />';
}
//* Set the function parameters.
$random_rs_id = 1;
$params = array(
'company_name' => 'awesomecompany',
'contact_name' => 'name',
'customer_no' => '1',
'vat_id' => '1',
'street' => 'fleetstreet',
'zip' => '21337',
'city' => 'london',
'state' => 'bavaria',
'country' => 'UK',
'telephone' => '123456789',
'mobile' => '987654321',
'fax' => '546718293',
'email' => 'e@mail.int',
'internet' => '',
'icq' => '111111111',
'notes' => 'awesome',
'dafault_mailserver' => 1,
'limit_maildomain' => -1,
'limit_mailbox' => -1,
'limit_mailalias' => -1,
'limit_mailaliasdomain' => -1,
'limit_mailforward' => -1,
'limit_mailcatchall' => -1,
'limit_mailrouting' => 0,
'limit_mailfilter' => -1,
'limit_fetchmail' => -1,
'limit_mailquota' => -1,
'limit_spamfilter_wblist' => 0,
'limit_spamfilter_user' => 0,
'limit_spamfilter_policy' => 1,
'default_webserver' => 1,
'limit_web_ip' => '',
'limit_web_domain' => -1,
'limit_web_quota' => -1,
'web_php_options' => 'no,fast-cgi,cgi,mod,suphp',
'limit_web_subdomain' => -1,
'limit_web_aliasdomain' => -1,
'limit_ftp_user' => -1,
'limit_shell_user' => 0,
'ssh_chroot' => 'no,jailkit,ssh-chroot',
'limit_webdav_user' => 0,
'default_dnsserver' => 1,
'limit_dns_zone' => -1,
'limit_dns_slave_zone' => -1,
'limit_dns_record' => -1,
'default_dbserver' => 1,
'limit_database' => -1,
'limit_cron' => 0,
'limit_cron_type' => 'url',
'limit_cron_frequency' => 5,
'limit_traffic_quota' => -1,
'limit_client' => 0,
'parent_client_id' => 0,
'username' => 'guy',
'password' => 'brush',
'language' => 'en',
'usertheme' => 'default',
'template_master' => 0,
'template_additional' => '',
'created_at' => 0
);
$affected_rows = $client->client_add($session_id, $random_rs_id, $params);
echo "Client: ".$affected_rows."<br>";
if($client->logout($session_id)) {
echo 'Logged out.<br />';
}
} catch (SoapFault $e) {
echo $client->__getLastResponse();
die('SOAP Error: '.$e->getMessage());
}
?>
For info, $username and $password are the password that i use to connect to my ISPC panel
|

15th January 2012, 14:12
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 32,066
Thanks: 697
Thanked 4,246 Times in 3,259 Posts
|
|
Quote:
|
For info, $username and $password are the password that i use to connect to my ISPC panel
|
That are the wrong user details. The remote API has its own user management and permissions, so you have to use the login details of a remoting user that you have to create under System > Remote users.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 23:48.
|
Recent comments
1 day 1 hour ago
1 day 4 hours ago
1 day 16 hours ago
1 day 18 hours ago
1 day 22 hours ago
2 days 5 hours ago
2 days 14 hours ago
2 days 16 hours ago
3 days 32 min ago
3 days 1 hour ago