Skip to content

WS501 - Consult Import Protocol

Objective

This integration aims to provide consultation on the progress of imports using the protocols received.

Method description

Método getImportProtocolStatus
Versão 1
WSDL principal https://soap.comprovei.com.br/importQueue/index.php?wsdl
WSDL de contingencia https://soapcontingencia.comprovei.com.br/importQueue/index.php?wsdl

Important

  1. The connection to our service must be made to our main server, however we strongly suggest that a connection to our contingency server is also made available, as a guarantee of the availability of our services. The contingency server is only turned on in situations where our main server is unavailable. Making the connection url parameterizable is also a good practice;
  2. Our connections are secure using the SSL protocol. For security reasons, our certificates are constantly changed without prior notice. Therefore, it is recommended that you do not develop integrations based on a fixed certificate.
  3. We constantly (and without prior notice) add new fields and structures to both requests and responses from our web services. Anyone who uses our webservices must implement it in such a way that the programs that consume these webservices do not stop working when the mentioned field changes occur.

Features

  • Calls will be made via SOAP over HTTPS;
  • The origin of the Web Service call will be the client's system;

Authentication

  • Calls will have transport-level authentication (Basic Authentication);
  • Request user / password from the account administrator.

Example HTTP header with authentication

POST https://soap.comprovei.com.br/importQueue/index.php HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:WebServiceComprovei#getImportProtocolStatus"
Authorization: Basic BASE64(user:password)
Content-Length: {quantidade de bytes enviados}
Host: soap.comprovei.com.br
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

Request

The request for our Web Service is composed as follows:

TA Type Description
protocolo string Protocol for checking the progress of the import request.

Request Example

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:WebServiceComprovei">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:getImportProtocolStatus soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <protocolo xsi:type="xsd:string">20170804598506cf87a0d</protocolo>
      </urn:getImportProtocolStatus>
   </soapenv:Body>
</soapenv:Envelope>

Response

Our Web Service responds to you as follows:

TAG Type Description
status string Success or error message for the method call.
protocolo string Protocol informed in the request.
metodo string Method requested when generating the import.
dataCriacao string Date and time of the import request.
dataConclusao string Date and time the import was completed.
processado string Sim or Não indicating that the import has already been processed.
resultado string Import success or error message (synchronous acceptance or asynchronous processing).

status values

API message literals are returned in Portuguese (as below).

status Note
Protocolo encontrado. Lookup ok; see resultado
Protocolo não encontrado. Unknown protocol
Por favor, envie o número de protocolo para a consulta. Empty protocol
Usuário não autenticado! 999
Método não autorizado para o seu usuário! 998

Typical resultado values

The resultado field may have been written at acceptance (synchronous error / duplicate file) or during asynchronous processing.

Document processing

Message (template) Success
Documentos importados com sucesso! yes
{n} Documentos importados. O restante apresentou estes erros: + - Documento {key}: {value} partial
Nenhum documento importado. Aconteceram os seguintes erros: + lines no
- Algum alertas foram gerados durante a importação: warning
Erro ao inserir o cliente! Parada: {n} - {error} per document
Erro ao inserir o documento! Parada: {n} - {error} per document
Documento não encontrado após inserção! dkey: {dkey} per document
Importado com sucesso, mas sem adicionar na fila de replicação! warning
Importado com sucesso, mas sem adicionar os itens na fila de replicação! warning

Route processing

Message (template) Success
Rota enviada para processamento. Por favor, aguarde alguns segundos. yes (deferred)
Rota importada com sucesso! yes
Falha ao enviar rota para fila SQS. Tente novamente. no
Erro ao inserir na imports! - {error} no
Erro ao inserir a base de origem! - {error} no
Erro ao inserir a base de destino! - {error} no
Erro ao inserir a rota! - {error} no
Erro ao cadastrar tipo de veiculo! no
Erro ao inserir no histórico! / Erro ao inserir no log! no
Erro ao inserir o cliente/documento/parada/itens/...! Parada: {n} no
Verbo {verb} não implementado. no

Idempotency / reprocessing

Message
Protocolo já em processamento!
Protocolo já processado!
ETag não encontrado

Response Example

<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:WebServiceComprovei" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <ns1:getImportProtocolStatusResponse>
         <status xsi:type="xsd:string">Protocolo encontrado.</status>
         <protocolo xsi:type="xsd:string">20170804598506cf87a0d</protocolo>
         <metodo xsi:type="xsd:string">uploadRoute</metodo>
         <dataCriacao xsi:type="xsd:string">04/08/2017 20:44:15</dataCriacao>
         <dataConclusao xsi:type="xsd:string">04/08/2017 20:44:34</dataConclusao>
         <processado xsi:type="xsd:string">Sim</processado>
         <resultado xsi:type="xsd:string">Rota importada com sucesso!</resultado>
      </ns1:getImportProtocolStatusResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>