Good day.
I am trying to upload an invoice to the webservice of the DIAN (tax entity in Colombia), previously I had created a publication for the part of the "WSS authentication" which was solved, but now the problem is that the webservice of the DIAN throws the error: Unexpected error [null] processing incoming WS request .
I have already investigated with the same DIAN but they never respond, if someone has already seen the topic and is connecting to the service, I would appreciate your response, I leave you the Request and Response:
The Request sent is:
POST /habilitacion/B2BIntegrationEngine/FacturaElectronica/facturaElectronica.wsdl HTTP/1.1
Host: facturaelectronica.dian.gov.co
Accept: */*
User-Agent: moneyBox
Content-Type: text/xml; charset=UTF-8
Content-Length: 28198
Expect: 100-continue
<!--?xml version="1.0" encoding="UTF-8"?-->
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rep="http://www.dian.gov.co/servicios/facturaelectronica/ReportarFactura">
<soapenv:header>
<wsse:security soapenv:mustunderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:usernametoken wsu:id="UsernameToken-2">
<wsse:username>d8xxxxxx-exxx-4xxx-axxx-aaxxxxxxxxxa</wsse:username>
<wsse:password type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile1.0#PasswordText">e098cxxxxxxxxxxxxxxxx4501b5</wsse:password>
<wsse:nonce encodingtype="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security1.0#Base64Binary">bW9xxxxxxxxxDcwNA==</wsse:nonce>
<wsu:created>2019-02-13T12:25:04.000Z</wsu:created>
</wsse:usernametoken>
</wsse:security>
</soapenv:header>
<soapenv:body>
<rep:enviofacturaelectronicapeticion>
<rep:nit>700xxxxxx</rep:nit>
<rep:invoicenumber>980000000</rep:invoicenumber>
<rep:issuedate>2019-02-13T12:25:04</rep:issuedate>
<rep:document>UEs...El_Zip_en_Base64....uMjcwNw==</rep:document>
</rep:enviofacturaelectronicapeticion>
</soapenv:body>
</soapenv:envelope>
And the response:
HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Wed, 13 Feb 2019 17:25:08 GMT
Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
SOAPAction: ""
Content-Type: Multipart/Related; start-info="text/xml"; type="application/xop+xml"; boundary="----=_Part_356292_546049942.1550078708580"
Set-Cookie: TS0133d910=01ca0e1ef651253b25b49afd1557f600dec2280bb5852510eeffa34063be7fa62f74d86b09c95f04d731f25eb78b11362ff2483058; Path=/
Transfer-Encoding: chunked
------=_Part_356292_546049942.1550078708580
Content-Type: application/xop+xml; charset=utf-8; type="text/xml"
<soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:header>
<wsse:security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" soap-env:mustunderstand="1">
..... muchas etiquetas del Firmado Digital... (Signature)
</wsse:security>
</soap-env:header>
<soap-env:body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:id="id-352783">
<ns2:enviofacturaelectronicarespuesta xmlns:ns2="http://www.dian.gov.co/servicios/facturaelectronica/ReportarFactura" xmlns:ns3="http://www.dian.gov.co/servicios/facturaelectronica/ConsultaDocumentos" xmlns:ns4="http://www.dian.gov.co/servicios/facturaelectronica/VersionDespliegue">
<ns2:version>Componente DIAN</ns2:version>
<ns2:receiveddatetime>2019-02-13T12:25:06.924-05:00</ns2:receiveddatetime>
<ns2:responsedatetime>2019-02-13T12:25:08.567-05:00</ns2:responsedatetime>
<ns2:response>100</ns2:response>
<ns2:comments>Error [null] inesperado al procesar la solicitud WS entrante..</ns2:comments>
</ns2:enviofacturaelectronicarespuesta>
</soap-env:body>
</soap-env:envelope>
------=_Part_356292_546049942.1550078708580--
Solved, the problem was not the way in which the data was sent, but that the DIAN Tax entity internally had not detected the problem, for which after spending more than 2 weeks insisting and insisting that they verify the error, they finally gave the solution and correction in their webservice, but until now the cheeky ones did not have the decency to answer the emails or the complaint in the PQRS, they only solved the reception and that's it.
Another important point is that the technical annexes are not 100% correct, the examples have very important typos that if you follow them to the letter you will never send the data, for example:
1) The boundary in the technical annexes is poorly indicated and used, here I tell you how I solved it: How to use MTOM with SOAP to attach files?
2) It is not indicated that to use the boundary you must set the header in the "Headers" of the socket, and not as part of the body of the message.
3) In the technical annexes a set of "headers" for the Electronic Invoice XML is mentioned, which is almost different from the headers of the Example XML offered by the DIAN. So which ones are correct? (I'm still fiddling with this).
4) In 2019 they changed the version of the UBL to be used, for which they now require other additional labels that are NOT mentioned in any technical annex and they published it just yesterday , Fabrero 20, 2019 within the "Tool Kit**.
5) The XML examples of the Toolkit are not well verified, there are errata in the headers and this standardization about WHICH headers you use in the XML continues to persist.
6) They changed faith: Invoice to Invoice but they do NOT mention it in any Annex, they only put it in their XML examples, this affects when their Webservice inspects the elements (access to the nodes).
If anyone has more to contribute, it would be appreciated because the DIAN is completely irresponsible in this "Electronic Billing Program", they do not answer the phones or the emails, much less my complaints in PQRS... I stay on seen :P