2016-08-18 81 views
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"; 
} 
?> 

回答

1

这个文档有点不完整,我无法连接的原因是因为我没有在ISPconfig中创建特定的远程用户。

加载Web界面,点击系统,然后选择左侧的远程用户。您可以在此创建您的用户,然后使用这些详细信息来连接和使用API​​。