SIGEP Post Office Troubleshooting Stickers()

Asked

Viewed 1,383 times

0

Friends,

I have a problem when I request the creation of labels in SIGEP-WEB. I am using php-Sigep.

Running the php-Sigep example all OK. In this case the example sends the tag number already. In my application I need to request this number from the post office.

In the "examples/helper-create-pre-list.php" file I include the line:

$params = new \PhpSigep\Model\SolicitaEtiquetas();
$params->setQtdEtiquetas(1);
$params->setServicoDePostagem(\PhpSigep\Model\ServicoDePostagem::SERVICE_PAC_41068);
$params->setAccessData(new \PhpSigep\Model\AccessDataHomologacao());

$etiqueta = \PhpSigep\Services\SoapClient\Real::solicitaEtiquetas($params);

In response to this request I have:

Phpsigep Services Result Object ( [isSoapFault:protected] => 1 [errorcode:protected] => 0 [errorMsg:protected] => Postal Response: Unable to retrieve requested tags. [result:protected] => [soapFault:protected] => [_failIfAtributeNotExist:protected] => 1 )

Can someone help me with that?

1 answer

1

Short answer

You cannot generate labels in type approval environment. You need to contact the Post Office to get your data access to the right environment (if you haven’t already).

Long answer

@leandro-carneiro, in that same file (very close to where vc added these new lines) there is this comment that I pasted below.

// Estamos criando uma etique falsa, mas em um ambiente real você deve usar o
// método {@link \PhpSigep\Services\SoapClient\Real::solicitaEtiquetas() }
// para gerar o número das etiquetas
$etiqueta = new \PhpSigep\Model\Etiqueta();
$etiqueta->setEtiquetaSemDv('PD73958096BR');

Also, I noticed that the code you entered in the file is trying to generate tags using the Post Office approval environment. The line of code that indicates this is: $params->setAccessData(new \PhpSigep\Model\AccessDataHomologacao());

The response you are receiving is not generated within the library. This message Resposta do Correios: Não foi possível obter as etiquetas solicitadas. means that it is the Webservice of the Post Office itself that is returning the message Não foi possível obter as etiquetas solicitadas..

For all these reasons, I believe your problem is that you are using the type-approval environment (which does not allow you to generate labels).

  • Thanks @Stavarengo! Although using the line that references the homologation file, the data was production. But the password that the client sent me was wrong. With the right password ran perfect!

  • @Leandrocarneiro , sorry to be resurrecting this topic, but I came across this problem today trying to carry out the integration for a customer, but the phone I have from the post office staff does not know how to inform anything about Production Environment or Approval. By chance could inform me on which phone I talk to them , what I have and the 03000888

Browser other questions tagged

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