php soap验证错误。 OSB-386101:缺少身份验证令牌

时间:2020-02-28 13:52:46

标签: php authentication soap service header

使用肥皂进行身份验证时,出现以下错误:OSB-386101:缺少身份验证令牌。

我按照以下方式进行认证:

$header = new SoapHeader($url, "header", array('user' => 'xxx','password' => 'xxx'), true);
$client->__setSoapHeaders($header);
$body = '......'; // xml with the body of the query
$result = $client->methodName(new SoapVar($body, XSD_ANYXML)); //here it explodes

标题应该如下

   <soapenv:Header>
      <user>Username</user>
      <pass>Password</pass>
   </soapenv:Header>

0 个答案:

没有答案