SOAP 身份验证问题
我对这个有点头疼。使用 NuSOAP。
Web 服务有一个名为 LOGIN 的函数,它接受参数 USER 和 PASSWORD。但无论我尝试通过 setCredentials 还是通过使用参数调用函数进行身份验证,我不断收到的都是相同的错误(身份验证因“null”而被拒绝)。这是我一直在使用的代码,在底部你会找到响应。
$client = new nusoap_client('http://user:[email protected]:9999/service?wsdl', 'WSDL');
//tested including user and password
//$client = new nusoap_client('http://user:[email protected]:9999/service?wsdl', 'WSDL');
//check if there were any instantiation errors, and if so stop execution with an error message:
$error = $client->getError();
if ($error)
{
die("client construction error: {$error}\n");
}
//authenticate to the service:
$client->setCredentials('user', 'pass');
$param = array('user' => 'user',
'password' => 'pass');
$answer = $client->call('login', array('parameters' => $param), '', '', false, true);
构造函数错误(
soapenv:Server: Auth rejected for 'null' (403)
故障
Array
(
[faultcode] => soapenv:Server
[faultstring] => Auth rejected for 'null' (403)
[detail] => Array
(
[ChargingException] => Array
(
[detail] =>
[message] => Auth rejected for 'null' (403)
)
)
)
Im having a bit of a headache with this one. Using NuSOAP.
The webservice has a function called LOGIN that accepts the parameters USER and PASSWORD. But all I keep getting is the same error (authentication rejected for 'null') no matter if I try to authenticate through setCredentials or by calling the function with the parameters. This is the code Ive been playing with,at the bottom youll find the response.
$client = new nusoap_client('http://user:[email protected]:9999/service?wsdl', 'WSDL');
//tested including user and password
//$client = new nusoap_client('http://user:[email protected]:9999/service?wsdl', 'WSDL');
//check if there were any instantiation errors, and if so stop execution with an error message:
$error = $client->getError();
if ($error)
{
die("client construction error: {$error}\n");
}
//authenticate to the service:
$client->setCredentials('user', 'pass');
$param = array('user' => 'user',
'password' => 'pass');
$answer = $client->call('login', array('parameters' => $param), '', '', false, true);
Constructor error
soapenv:Server: Auth rejected for 'null' (403)
Fault
Array
(
[faultcode] => soapenv:Server
[faultstring] => Auth rejected for 'null' (403)
[detail] => Array
(
[ChargingException] => Array
(
[detail] =>
[message] => Auth rejected for 'null' (403)
)
)
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论