Skip to content

WS115 - Receive Occurrences Using the Danfe Key

Objective

Receive all occurrences that are associated with a Danfe key.

Method description

Método getDanfeHistory
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;

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#getDanfeHistory"
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
ChaveDanfe string Key associated with Danfe.

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:getDanfeHistory soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <ChaveDanfe xsi:type="xsd:string">351704619402920001375502200092</ChaveDanfe>
      </urn:getDanfeHistory>
   </soapenv:Body>
</soapenv:Envelope>

Response

Our Web Service responds to you as follows:

TAG Type Description
CodigoRetorno integer Return message code (see table of Return codes).
MensagemRetorno string Return message (see table of Return codes).
Danfe element Element Danfe.

Danfe

Contains all danfe information, if any is found.

TAG Type Description
Numero string Danfe number.
Serie string Danfe series.
Documento element Contains information about the document to which this Danfe belongs. See Document.
Ocorrencias element List of Occurrence.

Document

Contains information from the document associated with Danfe.

TAG Type Description
Numero string Document number.

Occurrence

Contains information about the incident, if any has been reported.

TAG Type Description
Data string Date and time of occurrence in the format: YYYY-MM-DD HH:MM:SS.
Codigo string Occurrence code.
Descricao string Description of the occurrence.
Fotos element List of Photo, if any.
Rota element Information about the route associated with the occurrence, if any. See more at Rota.
Photo

Contains the URL to access the photo taken during the incident.

TAG Type Description
Foto string URL to access the photo taken at the incident.
Route

Contains information about the route associated with the occurrence, if any.

TAG Type Description
Data string Route date in the format: YYYY-MM-DD.
Nome string Route name.
Numero string Route number.
Placa string License plate of the route vehicle.
Regiao string Route region.
Transportadora element Information from the carrier responsible for the route. See more at Carrier.
Motorista element Information of the driver responsible for the route. See more at Driver.
Carrier

Contains information about the carrier responsible for the route

TAG Type Description
CNPJ string CNPJ of the carrier.
Nome string Name of the carrier.
Driver

Information of the driver responsible for the route

TAG Type Description
Codigo string Driver code.
Nome string Driver's name.

Return codes

Contains the list of all possible method return codes and messages.

Code Description
0 Key not found.
1 Key found.
998 Input parameter was not filled.
999 Unauthenticated user.

Response Examples

<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:getDanfeHistoryResponse>
         <CodigoRetorno xsi:type="xsd:integer">999</CodigoRetorno>
         <MensagemRetorno xsi:type="xsd:string">Usuário não autenticado!</MensagemRetorno>
         <Danfe xsi:nil="true" xsi:type="Danfe"/>
      </ns1:getDanfeHistoryResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<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:getDanfeHistoryResponse>
         <CodigoRetorno xsi:type="xsd:integer">0</CodigoRetorno>
         <MensagemRetorno xsi:type="xsd:string">Chave não encontrada!</MensagemRetorno>
         <Danfe xsi:nil="true" xsi:type="Danfe"/>
      </ns1:getDanfeHistoryResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<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:getDanfeHistoryResponse>
         <CodigoRetorno xsi:type="xsd:integer">1</CodigoRetorno>
         <MensagemRetorno xsi:type="xsd:string">Chave encontrada</MensagemRetorno>
         <Danfe xsi:type="Danfe">
            <Numero xsi:type="xsd:string">928460</Numero>
            <Serie xsi:type="xsd:string">22</Serie>
            <Documento xsi:type="Documento">
                <Numero xsi:type="xsd:string">31618</Numero>
            </Documento>
            <Ocorrencias xsi:type="Ocorrencias">
                <Ocorrencia xsi:type="Ocorrencia">
                    <Data xsi:type="xsd:string">2018-09-18 09:57:54</Data>
                    <Codigo xsi:type="xsd:string">0</Codigo>
                    <Descricao xsi:type="xsd:string">Entrega Normal</Descricao>
                    <Fotos xsi:type="Fotos">
                        <Foto xsi:type="xsd:string">http://images.comprovei.com.br/.....</Foto>
                    </Fotos>
                    <Rota xsi:type="Rota">
                        <Data xsi:type="xsd:string">2018-09-04</Data>
                        <Nome xsi:type="xsd:string">OSASCO</Nome>
                        <Numero xsi:type="xsd:string">159_400_2</Numero>
                        <Placa xsi:type="xsd:string">ELH1841</Placa>
                        <Regiao xsi:type="xsd:string">SPC</Regiao>
                        <Transportadora xsi:type="Transportadora">
                            <CNPJ xsi:type="xsd:string">17915300000101</CNPJ>
                            <Nome xsi:type="xsd:string">RONDOLOG TRANSPORTES LTDA</Nome>
                        </Transportadora>
                        <Motorista xsi:type="Motorista">
                            <Codigo xsi:type="xsd:string">00123104688</Codigo>
                            <Nome xsi:type="xsd:string">José Antonio Silva</Nome>
                        </Motorista>
                    </Rota>                    
                </Ocorrencia>
            </Ocorrencias>
         </Danfe>
      </ns1:getDanfeHistoryResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>