-1
Hello, good afternoon!
I’m trying to perform a SOAP request with the TNT webservice, but I’m getting a bug and I don’t know what to do.
Just follow my code:
$cliente = new SoapClient('http://ws.tntbrasil.com.br:81/tntws/CalculoFrete?wsdl');
$funcao = 'calculaFrete';
$parametros = array('calculaFrete' => array('in0' => array(
'cdDivisaoCliente' => 7,
'cepDestino' => '36213000',
'cepOrigem' => '36213000',
'login' => '[email protected]',
'nrIdentifClienteDest' => '00000000000',
'nrIdentifClienteRem' => '28672407000190',
'nrInscricaoEstadualDestinatario' => '0000000000000',
'nrInscricaoEstadualRemetente' => '0086585810022',
'psReal' => 15,
'senha' => '',
'tpFrete' => 'C',
'tpPessoaDestinatario' => 'F',
'tpPessoaRemetente' => 'J',
'tpServico' => 'RNC',
'tpSituacaoTributariaDestinatario' => 'CO',
'tpSituacaoTributariaRemetente' => 'CO',
'vlMercadoria' => 650.17,
)));
$resultado = null;
$resultado = $cliente->__soapCall($funcao, $parametros);
You’re making the following mistake
Fatal error: Uncaught SoapFault exception: [ns0:Server] java.lang.NullPointerException in C:\xampp\htdocs\tnt\index.php:27 Stack trace: #0 C:\xampp\htdocs\tnt\index.php(27): SoapClient->__soapCall('calculaFrete', Array) #1 {main} thrown in C:\xampp\htdocs\tnt\index.php on line 27
It is noteworthy that this code worked since 2018, but in recent weeks began to give this error, someone would know to inform what I am doing wrong??
From now on I thank you all for your help.
Helped too much, with this code worked well, I was already losing my head after my code stopped working, thank you very much!!!
– WFL