Remote API

samend

New Member
Hallo liebe Community,
ich versuche gerade die ISPCOnfig Remote API anzusprechen ein Login auf den Server ist zwar möglich jedoch bekomme ich eine SOAP-ERROR: Encoding: Cannot find encoding Meldung

<?php
$username = 'XXX';
$password = 'XXX';


/*
$soap_location = 'http://localhost:8080/ispconfig3/interface/web/remote/index.php';
$soap_uri = 'http://localhost:8080/ispconfig3/interface/web/remote/';
*/
$soap_location = 'https://localhost:8080/remote/index.php';
$soap_uri = 'https://localhost: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->sites_ftp_user_add($session_id, $client, $params);


$myusername = 'ftp_test';
$mypassword = 'shoe8ind';
$params = array( 'server_id' => '1',
'parent_domain_id' => '2',
'username' => $myusername,
'password' => $mypassword,
'quota_size' => '-1',
'active' => 'y',
//'uid' => 'web'.$domain_id,
//'gid' => 'client'.$client_id,
'uid' => 'web2',
'gid' => 'client2',
'dir' => '/var/www/clients/client2/web2',
'quota_files' => '-1',
'ul_ratio' => '-1',
'dl_ratio' => '-1',
'ul_bandwidth' => '-1',
'dl_bandwidth' => '-1');




$domain_id = $client->sites_ftp_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";
}

?>
 

Werbung

Top