4
I am at a time with a project of the post office, I had to make a connection with the webservice SIGEP WEB, I found something already in development in, I was using the same and everything OK, from one day to the other the same stopped working, I did some tests and noticed that the test web service I can use normally, but the production one is a timeout error.
I have valid users but it still doesn’t work, I created a simple script:
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); ini_set('error_reporting', 'E_ALL|E_STRICT'); error_reporting(E_ALL); $client = new SoapClient("https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl"); $function = 'buscaCliente'; $arguments= array('ConvertTemp' => array( 'idContrato' => "0000000000", 'idCartaoPostagem' => "0000000000", 'usuario' => "usuario", 'senha' => "senha" )); $options = array('location' => "https://apps.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente"); echo "aqui"; $result = $client->__Call($function, $arguments, $options); echo 'Response: '; foreach($result as $row){ foreach((object)$row->contratos->cartoesPostagem->servicos as $row2){ echo $row2->codigo; echo "
"; } }
Same works in PHP 5.2 but does not work in PHP 5.3, same time limit error occurs.
The system is developed in 5.3 and need to maintain this.
Does anyone have any reason for it to occur?
project I took and used in the system: (http://stavarengo.github.io/php-sigep/)
– Cabelu Oliveira
Try to increase the timeout
– Andre Mesquita
the timeout is sufficient because the same worked previously normally.
– Cabelu Oliveira
Hello, have you found a solution for the timeout?
– Marcel Kohls
I noticed here in our project that the production address only works on our server (which has https). That could be it, since the credit card API also only works from there. Anyway, if you have any right answers, it already helps.
– Marcel Kohls
The problem occurs in the version of PHP, The problem is that the system can not connect to the webservice using direct link, to solve I downloaded the code from the webservice and saved in wsdl format, ai instead of passing the link I pass the path to the file.
– Cabelu Oliveira