SIGEP WSDL problem

Asked

Viewed 845 times

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/)

  • the timeout is sufficient because the same worked previously normally.

  • Hello, have you found a solution for the timeout?

  • 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.

  • 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.

Show 1 more comment

1 answer

0

The index of the array $arguments cannot be "Converttemp", it needs to be "searchClient".

$arguments= array('buscaCliente' => array(
                    'idContrato' => "0000000000",
                    'idCartaoPostagem' => "0000000000",
                    'usuario'   => "usuario",
                    'senha'      => "senha"
            ));

Browser other questions tagged

You are not signed in. Login or sign up in order to post.