使用肥皂进行身份验证时,出现以下错误: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>