SIGEP two mails problems with requestTags ()

0

Friends,

I have a problem when I request the creation of labels in SIGEP-WEB. I'm using php-sigep.

Running the php-sigep example is 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 file "examples / helper-create-pre-list.php" 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] = > Post reply: The requested tags could not be retrieved.     [result: protected] = >     [soapFault: protected] = >     [_failIfAtributeNotExists: protected] = > 1 )

Can anyone help me with this?

    
asked by anonymous 08.12.2017 / 15:11

1 answer

1

Short answer

You can not generate labels in the homologation environment. You need to get in touch with the Post Office to get your access data to the correct environment (if you do not already have it).

Long answer

@ leandro-carneiro, in this same file (very close to where you added these new lines) there is this comment that I have 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');

In addition, I noticed that the code that you inserted into the file is trying to generate labels using the Post Approval environment. The line of code that indicates this is this: $params->setAccessData(new \PhpSigep\Model\AccessDataHomologacao());

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

For all these reasons, I think your problem is that you are using the approval environment (which does not allow the generation of labels).

    
12.12.2017 / 17:29