SOAP 身份验证问题

发布于 2024-12-03 15:27:23 字数 1574 浏览 0 评论 0原文

我对这个有点头疼。使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文