1
我已经看到了一些关于如何使用SOAP API的文章,但似乎无法得到它的真实性,我只收到以下消息: SOAP错误:登录失败。用户名或密码错误ISPconfig上的SOAP API 3
我知道用户/密码的详细信息是正确的,但我无法处理更具描述性的错误信息。
<?php
$username = 'admin';
$password = 'password';
$soap_location = 'https://test.uk:8080/remote/index.php';
$soap_uri = 'https://test.uk: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 successfully. The SessionID is '.$session_id.'';
}
//* Logout
if($client->logout($session_id)) {
echo "FTP Created";
}
} catch (SoapFault $e) {
die('SOAP Error: '.$e->getMessage());
echo "Please contact the server administator";
}
?>