I'm trying to authenticate in a WS but I can not connect, and I can connect and generate a token, but when trying to do other operations with a token I can not fill the header and validate the session, see the herader excerpt:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Autenticacao xmlns="servidoralvo.com.br/OperacoesPortador">
<Token>string</Token>
</Autenticacao>
</soap:Header>
<soap:Body>
<CartoesPortador xmlns="servidoralvo.com.br/OperacoesPortador">
<request>
<DocumentoPortador>string</DocumentoPortador>
</request>
</CartoesPortador>
</soap:Body>
</soap:Envelope>
I'm trying the following:
$Header = '
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Autenticacao xmlns="servidoralvo.com.br/OperacoesPortador">
<Token>' . $Token . '</Token>
</Autenticacao>
</soap:Header>
</soap:Envelope>';
$AHeader = $Client->setHeaders($Header);
$AParams = array();
$AParams["request"]["DocumentoPortador"] = "14238911996";
$Conexao = $Client->Call("CartoesPortador", array($AParams), '', '', true, true);
fPrintDebug($Conexao);
It gives authentication error, but it is not the token, the error is in the header construction, because that same token using the native PHP Soap works.
The detail is that on the server that I use on the web, there is no way to enable native Soap so I have to use NuSoap PHP
Would anyone have a clue what it could be?