ISPconfig 3 上的 SOAP API
SOAP API on ISPconfig 3
我看过一些关于如何使用 SOAP post 的文章 API 但似乎无法保证其真实性,我只收到以下消息:
SOAP 错误:登录失败。用户名或密码错误
我知道 user/password 详细信息是正确的,但我无法获得更具描述性的错误消息。
<?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";
}
?>
这方面的文档有点不完整,我无法连接的原因是我没有在 ISPconfig 中创建特定的远程用户。
加载网页界面,点击系统,然后在左侧选择远程用户。您可以在此处创建您的用户,然后使用这些详细信息连接和使用 API.
我看过一些关于如何使用 SOAP post 的文章 API 但似乎无法保证其真实性,我只收到以下消息: SOAP 错误:登录失败。用户名或密码错误
我知道 user/password 详细信息是正确的,但我无法获得更具描述性的错误消息。
<?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";
}
?>
这方面的文档有点不完整,我无法连接的原因是我没有在 ISPconfig 中创建特定的远程用户。
加载网页界面,点击系统,然后在左侧选择远程用户。您可以在此处创建您的用户,然后使用这些详细信息连接和使用 API.