Skip to content

WS114 - Receive Documents from Comprovei

Objective

This integration aims to receive documents with status AVAILABLE from Comprovei©.

Available documents are those that have not yet been assigned to any route. Therefore, when this method is requested, all documents with status AVAILABLE, respecting the quantity informed in the request, will be made available in a single XML file for consultation.

Method description

Método downloadDocuments
WSDL https://soap.comprovei.com.br/exportQueue/index.php?wsdl

Important

  1. 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.
  2. 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;

Important

The user of this Web Service must store the protocol generated in the response. Support tickets regarding this integration will require this protocol.

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/exportQueue/index.php HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:WebServiceComprovei#downloadDocuments"
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:

TAG Type Description
qtdDocumentos integer Maximum number of documents that will be returned by the query.

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:downloadDocuments soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <qtdDocumentos xsi:type="xsd:string">1</qtdDocumentos>
      </urn:downloadDocuments>
   </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 for checking the progress of the export request.

Protocol

When an export order is created in our system, a protocol is generated so that this process can be monitored. This can be done using the WS502 method.

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:downloadDocumentsResponse>
         <status xsi:type="xsd:string">Exportação adicionada a fila com sucesso. Acompanhe o processamento utilizando o protocolo fornecido!</status>
         <protocolo xsi:type="xsd:string">20170823599de095e8249</protocolo>
      </ns1:downloadDocumentsResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

What is generated in this export

Using the protocol generated in method WS502, the user will receive a URL to access the XML file containing all documents available in the system. This XML has the same format used to import documents into Comprovai.

To learn more about this file, access the WS013 documentation. There you will learn more about each TAG that makes up this XML, in addition to having access to its XSD.