I started a project using php 5.6.26 and managed to communicate with the e-frete server via SOAP without any problems.
This week I decided to update php to version 7.0.13, and communication via SOAP stopped working. I made several modifications based on examples on the internet, but nothing worked.
The following code works 100% in php 5.6.26 but not in php 7.0.13:
$obterOperacaoTransportePdf = [
'ObterOperacaoTransportePdfRequest' => [
'Integrador' => 'xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx', //Hash de referência ao integrador
'Versao' => '1', //Versão = 1
'CodigoIdentificacaoOperacao' => 'xxxxxxxxxx/aaaa', //Código de identificação da Operação (CIOT).
'DocumentoViagem' => ''
]
];
$options = array(
'local_cert' => $this->certKEY,
'soap_version' => SOAP_1_2,
'cache_wsdl' => WSDL_CACHE_NONE,
"style" => SOAP_RPC,
'connection_timeout' => 15,
'encoding' => 'UTF-8',
'trace' => 1,
'exceptions' => 1
);
$urlWsdl = 'https://sistema.efrete.com:6061/Services/PefService.asmx?wsdl';
$soap = new \SoapClient($urlWsdl, $options);
$data = $soap->ObterOperacaoTransportePdf($obterOperacaoTransportePdf);
Return when used PHP7:
[ObterOperacaoTransportePdfResult] => stdClass Object
(
[Versao] => 1
[Sucesso] =>
[Excecao] => stdClass Object
(
[Mensagem] => Sistema e-FRETE (www.efrete.com): [Negócio] (Protocolo: 86337) Erro obtendo PDF de operação de transporte: Integrador não cadastrado
)
[ProtocoloServico] => 86337
)
In PHP5, return the PDF as usual.
In conversation with the e-frete people, according to them, the 'Integrator' is not coming, so I'm thinking it's something that php7 is sending in the wrong way ...
Does anyone have any suggestions to mount differently to test? or if you already had something similar in php7 and solved ...
Thank you!