Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th December 2012, 14:32
AceLine AceLine is offline
Junior Member
 
Join Date: Oct 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation 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
Reply With Quote
Sponsored Links
  #2  
Old 11th December 2012, 15:05
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,403
Thanks: 834
Thanked 5,494 Times in 4,325 Posts
Default

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
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 11th December 2012, 16:32
AceLine AceLine is offline
Junior Member
 
Join Date: Oct 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up

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.
Reply With Quote
  #4  
Old 11th December 2012, 21:01
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,403
Thanks: 834
Thanked 5,494 Times in 4,325 Posts
Default

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/';
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 11th December 2012, 21:14
AceLine AceLine is offline
Junior Member
 
Join Date: Oct 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #6  
Old 12th December 2012, 08:20
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,403
Thanks: 834
Thanked 5,494 Times in 4,325 Posts
Default

Have you tried https instaed of http?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 12th December 2012, 08:23
AceLine AceLine is offline
Junior Member
 
Join Date: Oct 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes I´ve tried it with https. also the same. firefox can not connect to server. is TCP ok in the firewall?
Reply With Quote
  #8  
Old 12th December 2012, 08:29
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,403
Thanks: 834
Thanked 5,494 Times in 4,325 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 12th December 2012, 08:44
AceLine AceLine is offline
Junior Member
 
Join Date: Oct 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote
  #10  
Old 12th December 2012, 08:56
AceLine AceLine is offline
Junior Member
 
Join Date: Oct 2010
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

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
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ispconfig API change MYSQL Password Moundy Installation/Configuration 4 29th May 2012 11:09
ISPConfig 3.0.3.1 released till General 11 22nd April 2011 12:22
ISPConfig 3.0.3.1 API holykim Developers' Forum 4 16th December 2010 14:10
PHP warnings after upgrade to ISP config 3.03 stevegjacobs Installation/Configuration 5 30th October 2010 14:31
ISPConfig 3.0.1 released till General 36 29th March 2009 14:30


All times are GMT +2. The time now is 17:26.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.