
11th December 2012, 14:32
|
|
Junior Member
|
|
Join Date: Oct 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
SOAP API on IspConfig 3.0.3.1?
Hi Till,
Hi Falco,
I have one - for me - very important question:
I have installed ISPC 3.0.3.1 on my server. Now I had a look at the api examples in the tar.gz-folder of ISPC 3.0.4.6...
Can I use this SOAP-Examples 1:1 on the 3.0.3.1 version?
If not: how to update to the 3.0.4.6 version with 100% prevention of loosing data...? (the server is on production state and no data should be lost)
Or can I just copy the api folder contents to the 3.0.3.1 server version?
Thnx. in advance for your information and...
...best regards!
AceLine
|

11th December 2012, 15:05
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,182 Times in 3,201 Posts
|
|
This is a very old version and you can not use the api of a newer version with that version of course. Just update your sytm to 3.0.4.6. Btw, if you want to keep your system secure and prevent data loss, then you should update regularily.
Quote:
|
If not: how to update to the 3.0.4.6 version with 100% prevention of loosing data...? (the server is on production state and no data should be lost)
|
Just follow the normal update procedure as described in the release note:
http://www.howtoforge.com/forums/showthread.php?t=57659
|

11th December 2012, 16:32
|
|
Junior Member
|
|
Join Date: Oct 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi Till,
thnx. for your answer. I did the update now but I get a SOAP Error: Could not connect to host error.
what could I check (port 8080, where to check if it is active, etc.) to get closer to the problem?
Hope, you have any help for me...
Best regards from Austria,
AceLine
Quote:
$uid = $_POST['uid'];
$username = strtolower(umlaute(str_replace(" ", ".", $_POST['username'])));
$prefix = $_POST['emailPrefix'];
$email = urldecode($username).$prefix."@"._sitename;
$qry = sql_insert("INSERT INTO email_prefix (email_prefix,uid) VALUES ('".$username.$prefix."',".$uid.")", 2);
$username = 'admin';
$password = 'geheimespasswort';
/*
$soap_location = 'http://localhost:8080/ispconfig3/interface/web/remote/index.php';
$soap_uri = 'http://localhost:8080/ispconfig3/interface/web/remote/';
*/
$soap_location = 'http://localhost:8080/remote/index.php';
$soap_uri = 'http://localhost: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.
$client_id = 1;
$params = array(
'server_id' => 1,
'email' => $email,
'login' => $email,
'password' => $username.$uid,
'name' => $_SESSION['username'],
'uid' => (5000+intval($uid)),
'gid' => (5000+intval($uid)),
'maildir' => '/var/www/'._sitename.'/'.$username.$prefix,
'quota' => 10000000000,
'cc' => '',
'homedir' => '',
'autoresponder' => 'n',
'autoresponder_start_date' => '',
'autoresponder_end_date' => '',
'autoresponder_text' => 'hallo',
'move_junk' => 'n',
'custom_mailfilter' => 'spam',
'postfix' => 'y',
'access' => 'n',
'disableimap' => 'n',
'disablepop3' => 'n',
'disabledeliver' => 'n',
'disablesmtp' => 'n'
);
$affected_rows = $client->mail_user_add($session_id, $client_id, $params);
echo "New user: ".$affected_rows."<br>";
if($client->logout($session_id)) {
echo 'Logged out.<br />';
}
} catch (SoapFault $e) {
echo $client->__getLastResponse();
die('SOAP Error: '.$e->getMessage());
}
echo "ok";
|
Last edited by AceLine; 11th December 2012 at 19:27.
|

11th December 2012, 21:01
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,182 Times in 3,201 Posts
|
|
Ensure that you use the correct URL that matches your server hostname and http/https in these variables, you must be able to open the url in your web browser:
$soap_location = 'http://localhost:8080/remote/index.php';
$soap_uri = 'http://localhost:8080/remote/';
|

11th December 2012, 21:14
|
|
Junior Member
|
|
Join Date: Oct 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ok, I will change the URLs... but I can´t get connection through browser:
Fehler: Verbindung fehlgeschlagen
Firefox kann keine Verbindung zu dem Server unter ns3.artetplus.at:8080 aufbauen.
Do you have any idea? The firewall is set to "TCP from any port to 8080 allow access".
Thnx. in advance,
AceLine
PS: Changed the URLs but still no SOAP connection possible
Last edited by AceLine; 11th December 2012 at 21:18.
|

12th December 2012, 08:20
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,182 Times in 3,201 Posts
|
|
Have you tried https instaed of http?
|

12th December 2012, 08:23
|
|
Junior Member
|
|
Join Date: Oct 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
yes I´ve tried it with https. also the same. firefox can not connect to server. is TCP ok in the firewall?
|

12th December 2012, 08:29
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,872
Thanks: 689
Thanked 4,182 Times in 3,201 Posts
|
|
The soap connection is the same then the one that you use to access the ispconfig interface in the browser. So if you are able to login to ispconfig at all, then you must be able to access the soap interface as well, soap is just a different subfolder ( /remote/ ) of the same base URL.
|

12th December 2012, 08:44
|
|
Junior Member
|
|
Join Date: Oct 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok...  ) That changes a lot... I do not use ISPC 3 on standard port... now it connects.
Thanx. a lot!!!
Best regards,
Ingmar aka AceLine
|

12th December 2012, 08:56
|
|
Junior Member
|
|
Join Date: Oct 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry, Till... I´ve got one more question to this:
It allways shows me a SOAP-Error that the password is wrong. I used the admin username with its password (I very often login manualy) and I used the user that belongs to the mailboxes to add to.
Can you give me one more time an idea?
Thnx. in advance.
Ingmar
|
| 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 15:25.
|
Recent comments
15 hours 9 min ago
18 hours 4 min ago
19 hours 18 min ago
20 hours 41 min ago
22 hours 19 min ago
23 hours 48 min ago
1 day 1 hour ago
1 day 16 hours ago
1 day 17 hours ago
1 day 21 hours ago