我看过几篇关于如何使用 SOAP API 的帖子,但似乎无法让它变得真实,我只收到以下消息:SOAP 错误:登录失败。用户名或密码错误
我知道用户/密码详细信息是正确的,但我无法获得更具描述性的错误消息。
<?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";
}
?>