View Single Post
  #1  
Old 2nd September 2011, 15:18
kassyo kassyo is offline
Junior Member
 
Join Date: Oct 2010
Posts: 19
Thanks: 6
Thanked 2 Times in 2 Posts
Default ISPConfig 3 Remote api - SOAP error

Hello everyone,

Im actually doing a script for migrating massive mailboxes from another mail server but when i execute the script appears the following:

PHP Code:
Logged into remote server sucessfullyThe SessionID is 7730995c3dccf15af9ff59596332ed6cSOAP ErrorSOAP-ERROREncodingCannot find encoding 
The script is the following:

PHP Code:
<?php
$username 
'xxxx';
$password 'xxxx';
/*
$soap_location = 'http://localhost:8080/ispconfig3/interface/web/remote/index.php';
$soap_uri = 'http://localhost:8080/ispconfig3/interface/web/remote/';
*/
$soap_location 'http://correo.pruebas.com:8080/remote/index.php';
$soap_uri 'http://correo.pruebas.com:8080/remote/';

$client = new SoapClient(null, array('location' => $soap_location
                                     
'uri'      => $soap_uri));
try {
    
//* Login to the remote server
    
if($session_id $client->login($username,$password)) 
        echo 
'Logged into remote server sucessfully. The SessionID is '.$session_id.'';
    

//$domain_id = $client->mail_user_add($session_id, $client, $params);

$params = array( 'server_id' => '1',
                 
'email' => /*$email*/'pruebas@pruebas.com',/*Direccion completa*/
                 
'password' => /*$password*/'pruebas',
                 
'name' => /*$nombre*/'pruebecitas',
                 
'quota' => '0',
                 
'cc' => '',
                 
'maildir' => '/var/vmail/pruebas.com/'.'pruebas'/*$username*/,
                 
'homedir' => '/var/vmail',
                 
'uid' => '5000',
                 
'gid' => '5000',
                 
'postfix' => 'y',
                 
/*
                 'access' => array (
                    'datatype'    => 'VARCHAR',
                    'formtype'    => 'CHECKBOX',
                    'default'    => 'y',
                    'value'        => array(1 => 'y',0 => 'n')
                 ),
                 */
                 
'disableimap' => 'n',
                 
'disablepop3' => 'n',);
    
$domain_id $client->mail_user_add($session_id$client$params);

//* Logout
    
if($client->logout($session_id)) {
        echo 
"Usuario de correo dado de alta correctamente";
    }
    
} catch (
SoapFault $e) {
    die(
'SOAP Error: '.$e->getMessage());
    echo 
"Please contact the server administator";
}

?>
I think its a php-soap issue but not sure Googled a lot and didnt find anything.

The server config is taken from "The Perfect Server - OpenSUSE 11.4 x86_64 [ISPConfig 3]".

Any thoughts anyone?
Reply With Quote
Sponsored Links