我有这个HTML代码
<form action="/domains/login.php">
</div>
<div class="container">
<label for="username"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="username" required>
<label for="password"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="password"
required>
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
<div class="container" style="background-color:#f1f1f1">
<button type="button" class="cancelbtn">Cancel</button>
<span class="psw">Forgot <a href="#">password?</a></span>
</div>
</form>
并且这个PHP代码与api集成
$soapUrl = "http://202.171.47.206:8080/ResellerAPI/ResellerAPIWs?wsdl";
$username = 'username';
$password = 'password';
$client = new SoapClient($soapUrl);
$result = $client->login(array('username' => $username, 'password' =>
$password))->return;
$xml = new SimpleXMLElement($result);
if ((string) $xml->code === '1000') {
echo "Login successful";
} else {
echo "Login failed";
throw new Exception("Error:" . $xml->reason . " -- " . $xml->code);
}
?>
即时使用此代码进行集成然后获取此错误
Login failed
Fatal error: Uncaught Exception: Error: Login failed -- 9999 in
/home/kognifi6/public_html/domains/login.php:16 Stack trace: #0 {main}
thrown in /home/kognifi6/public_html/domains/login.php on line 16
然后我希望这会解决因为这个肥皂api的新手。