Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Internet
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Colaboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 14-07-2021
skatologiko skatologiko is offline
Miembro
 
Registrado: jul 2021
Posts: 38
Poder: 0
skatologiko Va por buen camino
A Guipuzcoa. Si envío un NIF español, sí que llega

<Destinatarios>
<IDDestinatario>
<NIF>NL855820627B01</NIF>
<ApellidosNombreRazonSocial>ITX MERKEN B.V.</ApellidosNombreRazonSocial>
</IDDestinatario>
</Destinatarios>

Y me da el siguiente error:
Error: El fichero de alta TicketBAI no cumple el esquema XSD. Detalle del error: cvc-pattern-valid: Value 'NL855820627B01' is not facet-valid with respect to pattern '(([a-z|A-Z]{1}\d{7}[a-z|A-Z]{1})|(\d{8}[a-z|A-Z]{1})|([a-z|A-Z]{1}\d{8}))' for type 'NIFType'.</Descripcion>

Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
¿Dónde la estás enviando?
y

¿Qué estás enviando? (puedes poner el trozo del XML)
(sección de <Destinatarios>)
Responder Con Cita
  #2  
Antiguo 14-07-2021
skatologiko skatologiko is offline
Miembro
 
Registrado: jul 2021
Posts: 38
Poder: 0
skatologiko Va por buen camino
Bueno, parece que finalmente sí que consigo enviar el XML, recoger la firma para encadenar y generar el QR (al menos para Guipuzcoa)
Lo que no consigo es que dicho QR sea correcto. No sé si porque estoy obtieniendo el CRC mal, o cual es el motivo. (Y tampoco he visto ninguna url que funcione en todo el hilo)
Me genera la siguiente cadena:
https ://tbai.prep.gipuzkoa.eus/qr/?id=TBAI-B09500307-130521-YiT5C1USVoYiN-002&s=MP&nf=210914&i=5348.20&cr=245
No accede a la factura pero si accedo desde : https ://tbai.prep.gipuzkoa.eus/qr/verificar , ahí si que la encuentra
También he probado con: https ://tbai.egoitza.gipuzkoa.eus/qr/verificar ,pero ahí tampoco la encuentra ¿qué diferencia hay entre un subdominio y el otro?

La función en VB que utilizo para el cálculo del CRC es:

Public Function calculateCRC8(ByVal AppID As String) As String
Dim CRC8 As Byte
Dim i As Integer
Dim j As Integer
Dim AppIDarray() As Byte '<--- explicitly dimensioned as a Byte array to avoid confusion
Dim aidLength As Integer


CRC8 = &HC7

'The AppID is actually bytes stored in hexadecimal in a string. You have to convert them back to bytes before you can run a crc8 on them.
AppIDarray = HexToByte(AppID)
aidLength = UBound(AppIDarray)
For j = 0 To aidLength
CRC8 = CRC8 Xor AppIDarray(j)
For i = 1 To 8
If CRC8 And &H80 Then
'masking off the left-most bit before shifting prevents the Overflow error.
CRC8 = ((&H7F And CRC8) * 2) Xor &H1D
Else
CRC8 = CRC8 * 2
End If
Next i
Next j
calculateCRC8 = CRC8
End Function

Private Function HexToByte(strHex As String) As Byte()
Dim i As Integer
Dim j As Integer
Dim tempByte As Byte
Dim outBytes() As Byte
Dim Char As String
ReDim outBytes(Len(strHex) \ 2 - 1)
For i = 0 To Len(strHex) \ 2 - 1
For j = 0 To 1
Char = Mid(strHex, i * 2 + j + 1, 1)
Select Case Char
Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9":
tempByte = tempByte Or (Asc(Char) - 48)
Case "A", "B", "C", "D", "E", "F":
tempByte = tempByte Or (Asc(Char) - 55)
End Select
If j = 0 Then
tempByte = tempByte * 2 ^ 4
Else
outBytes(i) = tempByte
tempByte = 0
End If
Next
Next
HexToByte = outBytes
End Function
Responder Con Cita
  #3  
Antiguo 15-07-2021
jaiser jaiser is offline
Miembro
 
Registrado: abr 2021
Posts: 18
Poder: 0
jaiser Va por buen camino
Te paso la que tengo yo hecha en vb.net a ver si te sirve o te da pistas.

Public Shared Function calculatecrc8(ByVal input As String) As String
Dim crc8_table() As Byte = New Byte() {CByte(&H0), CByte(&H7), CByte(&HE), CByte(&H9), CByte(&H1C), CByte(&H1B), CByte(&H12), CByte(&H15), CByte(&H38), CByte(&H3F), CByte(&H36), CByte(&H31), CByte(&H24), CByte(&H23), CByte(&H2A), CByte(&H2D), CByte(&H70), CByte(&H77), CByte(&H7E), CByte(&H79), CByte(&H6C), CByte(&H6B), CByte(&H62), CByte(&H65), CByte(&H48), CByte(&H4F), CByte(&H46), CByte(&H41), CByte(&H54), CByte(&H53), CByte(&H5A), CByte(&H5D), CByte(&HE0), CByte(&HE7), CByte(&HEE), CByte(&HE9), CByte(&HFC), CByte(&HFB), CByte(&HF2), CByte(&HF5), CByte(&HD8), CByte(&HDF), CByte(&HD6), CByte(&HD1), CByte(&HC4), CByte(&HC3), CByte(&HCA), CByte(&HCD), CByte(&H90), CByte(&H97), CByte(&H9E), CByte(&H99), CByte(&H8C), CByte(&H8B), CByte(&H82), CByte(&H85), CByte(&HA8), CByte(&HAF), CByte(&HA6), CByte(&HA1), CByte(&HB4), CByte(&HB3), CByte(&HBA), CByte(&HBD), CByte(&HC7), CByte(&HC0), CByte(&HC9), CByte(&HCE), CByte(&HDB), CByte(&HDC), CByte(&HD5), CByte(&HD2), CByte(&HFF), CByte(&HF8), CByte(&HF1), CByte(&HF6), CByte(&HE3), CByte(&HE4), CByte(&HED), CByte(&HEA), CByte(&HB7), CByte(&HB0), CByte(&HB9), CByte(&HBE), CByte(&HAB), CByte(&HAC), CByte(&HA5), CByte(&HA2), CByte(&H8F), CByte(&H88), CByte(&H81), CByte(&H86), CByte(&H93), CByte(&H94), CByte(&H9D), CByte(&H9A), CByte(&H27), CByte(&H20), CByte(&H29), CByte(&H2E), CByte(&H3B), CByte(&H3C), CByte(&H35), CByte(&H32), CByte(&H1F), CByte(&H18), CByte(&H11), CByte(&H16), CByte(&H3), CByte(&H4), CByte(&HD), CByte(&HA), CByte(&H57), CByte(&H50), CByte(&H59), CByte(&H5E), CByte(&H4B), CByte(&H4C), CByte(&H45), CByte(&H42), CByte(&H6F), CByte(&H68), CByte(&H61), CByte(&H66), CByte(&H73), CByte(&H74), CByte(&H7D), CByte(&H7A), CByte(&H89), CByte(&H8E), CByte(&H87), CByte(&H80), CByte(&H95), CByte(&H92), CByte(&H9B), CByte(&H9C), CByte(&HB1), CByte(&HB6), CByte(&HBF), CByte(&HB8), CByte(&HAD), CByte(&HAA), CByte(&HA3), CByte(&HA4), CByte(&HF9), CByte(&HFE), CByte(&HF7), CByte(&HF0), CByte(&HE5), CByte(&HE2), CByte(&HEB), CByte(&HEC), CByte(&HC1), CByte(&HC6), CByte(&HCF), CByte(&HC8), CByte(&HDD), CByte(&HDA), CByte(&HD3), CByte(&HD4), CByte(&H69), CByte(&H6E), CByte(&H67), CByte(&H60), CByte(&H75), CByte(&H72), CByte(&H7B), CByte(&H7C), CByte(&H51), CByte(&H56), CByte(&H5F), CByte(&H58), CByte(&H4D), CByte(&H4A), CByte(&H43), CByte(&H44), CByte(&H19), CByte(&H1E), CByte(&H17), CByte(&H10), CByte(&H5), CByte(&H2), CByte(&HB), CByte(&HC), CByte(&H21), CByte(&H26), CByte(&H2F), CByte(&H28), CByte(&H3D), CByte(&H3A), CByte(&H33), CByte(&H34), CByte(&H4E), CByte(&H49), CByte(&H40), CByte(&H47), CByte(&H52), CByte(&H55), CByte(&H5C), CByte(&H5B), CByte(&H76), CByte(&H71), CByte(&H78), CByte(&H7F), CByte(&H6A), CByte(&H6D), CByte(&H64), CByte(&H63), CByte(&H3E), CByte(&H39), CByte(&H30), CByte(&H37), CByte(&H22), CByte(&H25), CByte(&H2C), CByte(&H2B), CByte(&H6), CByte(&H1), CByte(&H8), CByte(&HF), CByte(&H1A), CByte(&H1D), CByte(&H14), CByte(&H13), CByte(&HAE), CByte(&HA9), CByte(&HA0), CByte(&HA7), CByte(&HB2), CByte(&HB5), CByte(&HBC), CByte(&HBB), CByte(&H96), CByte(&H91), CByte(&H98), CByte(&H9F), CByte(&H8A), CByte(&H8D), CByte(&H84), CByte(&H83), CByte(&HDE), CByte(&HD9), CByte(&HD0), CByte(&HD7), CByte(&HC2), CByte(&HC5), CByte(&HCC), CByte(&HCB), CByte(&HE6), CByte(&HE1), CByte(&HE8), CByte(&HEF), CByte(&HFA), CByte(&HFD), CByte(&HF4), CByte(&HF3)}

Dim data() As Byte = System.Text.Encoding.UTF8.GetBytes(input)
Dim len As Integer = data.Length
Dim crc As Byte = 0
For i As Integer = 0 To len - 1
crc = crc8_table((crc Xor data(i)) And 255)
Next i
Return String.Format("{03}", crc And &HFFL)
End Function
Responder Con Cita
  #4  
Antiguo 15-07-2021
jaiser jaiser is offline
Miembro
 
Registrado: abr 2021
Posts: 18
Poder: 0
jaiser Va por buen camino
Y la función en java de las dipus, que yo a partir de esa hice la de vb.net

10. 3. ERANSKINA – CRC EGIAZTATZEKO ALGORITMOA / 10. ANEXO 3 – ALGORITMO CRC DE COMPROBACIÓN
package net.ticketbai;
import java.io.UnsupportedEncodingException;
public class CRC8{
private static final String UTF_8 = “UTF-8”;
// CRC-8,
// Poly = x^8 + x^2 + x^1 + x^0
// Init = 0
// RefIn = false
// RefOut = false
// XorOut = 0
private static final byte[] crc8_table =
new byte[] {
(byte) 0x00, (byte) 0x07, (byte) 0x0E, (byte) 0x09, (byte) 0x1C, (byte) 0x1B, (byte) 0x12, (byte) 0x15,
(byte) 0x38, (byte) 0x3F, (byte) 0x36, (byte) 0x31, (byte) 0x24, (byte) 0x23, (byte) 0x2A, (byte) 0x2D,
(byte) 0x70, (byte) 0x77, (byte) 0x7E, (byte) 0x79, (byte) 0x6C, (byte) 0x6B, (byte) 0x62, (byte) 0x65,
(byte) 0x48, (byte) 0x4F, (byte) 0x46, (byte) 0x41, (byte) 0x54, (byte) 0x53, (byte) 0x5A, (byte) 0x5D,
(byte) 0xE0, (byte) 0xE7, (byte) 0xEE, (byte) 0xE9, (byte) 0xFC, (byte) 0xFB, (byte) 0xF2, (byte) 0xF5,
(byte) 0xD8, (byte) 0xDF, (byte) 0xD6, (byte) 0xD1, (byte) 0xC4, (byte) 0xC3, (byte) 0xCA, (byte) 0xCD,
(byte) 0x90, (byte) 0x97, (byte) 0x9E, (byte) 0x99, (byte) 0x8C, (byte) 0x8B, (byte) 0x82, (byte) 0x85,
(byte) 0xA8, (byte) 0xAF, (byte) 0xA6, (byte) 0xA1, (byte) 0xB4, (byte) 0xB3, (byte) 0xBA, (byte) 0xBD,
(byte) 0xC7, (byte) 0xC0, (byte) 0xC9, (byte) 0xCE, (byte) 0xDB, (byte) 0xDC, (byte) 0xD5, (byte) 0xD2,
(byte) 0xFF, (byte) 0xF8, (byte) 0xF1, (byte) 0xF6, (byte) 0xE3, (byte) 0xE4, (byte) 0xED, (byte) 0xEA,
(byte) 0xB7, (byte) 0xB0, (byte) 0xB9, (byte) 0xBE, (byte) 0xAB, (byte) 0xAC, (byte) 0xA5, (byte) 0xA2,
(byte) 0x8F, (byte) 0x88, (byte) 0x81, (byte) 0x86, (byte) 0x93, (byte) 0x94, (byte) 0x9D, (byte) 0x9A,
(byte) 0x27, (byte) 0x20, (byte) 0x29, (byte) 0x2E, (byte) 0x3B, (byte) 0x3C, (byte) 0x35, (byte) 0x32,
(byte) 0x1F, (byte) 0x18, (byte) 0x11, (byte) 0x16, (byte) 0x03, (byte) 0x04, (byte) 0x0D, (byte) 0x0A,
(byte) 0x57, (byte) 0x50, (byte) 0x59, (byte) 0x5E, (byte) 0x4B, (byte) 0x4C, (byte) 0x45, (byte) 0x42,
(byte) 0x6F, (byte) 0x68, (byte) 0x61, (byte) 0x66, (byte) 0x73, (byte) 0x74, (byte) 0x7D, (byte) 0x7A,
(byte) 0x89, (byte) 0x8E, (byte) 0x87, (byte) 0x80, (byte) 0x95, (byte) 0x92, (byte) 0x9B, (byte) 0x9C,
(byte) 0xB1, (byte) 0xB6, (byte) 0xBF, (byte) 0xB8, (byte) 0xAD, (byte) 0xAA, (byte) 0xA3, (byte) 0xA4,
(byte) 0xF9, (byte) 0xFE, (byte) 0xF7, (byte) 0xF0, (byte) 0xE5, (byte) 0xE2, (byte) 0xEB, (byte) 0xEC,
(byte) 0xC1, (byte) 0xC6, (byte) 0xCF, (byte) 0xC8, (byte) 0xDD, (byte) 0xDA, (byte) 0xD3, (byte) 0xD4,
(byte) 0x69, (byte) 0x6E, (byte) 0x67, (byte) 0x60, (byte) 0x75, (byte) 0x72, (byte) 0x7B, (byte) 0x7C,
(byte) 0x51, (byte) 0x56, (byte) 0x5F, (byte) 0x58, (byte) 0x4D, (byte) 0x4A, (byte) 0x43, (byte) 0x44,
(byte) 0x19, (byte) 0x1E, (byte) 0x17, (byte) 0x10, (byte) 0x05, (byte) 0x02, (byte) 0x0B, (byte) 0x0C,
(byte) 0x21, (byte) 0x26, (byte) 0x2F, (byte) 0x28, (byte) 0x3D, (byte) 0x3A, (byte) 0x33, (byte) 0x34,
(byte) 0x4E, (byte) 0x49, (byte) 0x40, (byte) 0x47, (byte) 0x52, (byte) 0x55, (byte) 0x5C, (byte) 0x5B,
(byte) 0x76, (byte) 0x71, (byte) 0x78, (byte) 0x7F, (byte) 0x6A, (byte) 0x6D, (byte) 0x64, (byte) 0x63,
(byte) 0x3E, (byte) 0x39, (byte) 0x30, (byte) 0x37, (byte) 0x22, (byte) 0x25, (byte) 0x2C, (byte) 0x2B,
(byte) 0x06, (byte) 0x01, (byte) 0x08, (byte) 0x0F, (byte) 0x1A, (byte) 0x1D, (byte) 0x14, (byte) 0x13,
(byte) 0xAE, (byte) 0xA9, (byte) 0xA0, (byte) 0xA7, (byte) 0xB2, (byte) 0xB5, (byte) 0xBC, (byte) 0xBB,
(byte) 0x96, (byte) 0x91, (byte) 0x98, (byte) 0x9F, (byte) 0x8A, (byte) 0x8D, (byte) 0x84, (byte) 0x83,
(byte) 0xDE, (byte) 0xD9, (byte) 0xD0, (byte) 0xD7, (byte) 0xC2, (byte) 0xC5, (byte) 0xCC, (byte) 0xCB,
(byte) 0xE6, (byte) 0xE1, (byte) 0xE8, (byte) 0xEF, (byte) 0xFA, (byte) 0xFD, (byte) 0xF4, (byte) 0xF3 };
/**
*Calculate the CRC value with data from input string.
*@param input input string
*@return The calculated CRC value. Left padding with zeros.
* @throws UnsupportedEncodingException
*/
public static String calculate(String input) throws UnsupportedEncodingException {
byte[] data = input.getBytes(UTF_8);
int len = data.length;
byte crc = 0;
for (int i = 0; i < len; i++)
crc = crc8_table[(crc ^ data[i]) & 0xff];
return String.format(“%03d”, crc & 0xFFL);
}}
Responder Con Cita
  #5  
Antiguo 15-07-2021
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is online now
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.459
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por skatologiko Ver Mensaje
A Guipuzcoa. Si envío un NIF español, sí que llega

<Destinatarios>
<IDDestinatario>
<NIF>NL855820627B01</NIF>
<ApellidosNombreRazonSocial>ITX MERKEN B.V.</ApellidosNombreRazonSocial>
</IDDestinatario>
</Destinatarios>

Y me da el siguiente error:
Error: El fichero de alta TicketBAI no cumple el esquema XSD. Detalle del error: cvc-pattern-valid: Value 'NL855820627B01' is not facet-valid with respect to pattern '(([a-z|A-Z]{1}\d{7}[a-z|A-Z]{1})|(\d{8}[a-z|A-Z]{1})|([a-z|A-Z]{1}\d{8}))' for type 'NIFType'.</Descripcion>

Creo que en el caso de clientes extranjeros hay que enviar otra estructura:
Código PHP:
      <Destinatarios>
            <
IDDestinatario>
                <
IDOtro>
                    <
CodigoPais>NL</CodigoPais>
                    <
IDType>04</IDType>
                    <
ID>NL855820627B01</ID>
                </
IDOtro>
                <
ApellidosNombreRazonSocial>ITX MERKEN B.V.</ApellidosNombreRazonSocial>
                <
CodigoPostal>...</CodigoPostal>
                <
Direccion>...</Direccion>
            </
IDDestinatario>
        </
Destinatarios
En la parte del IDDestinatario:


Y el IDOtro:
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.

Última edición por Neftali [Germán.Estévez] fecha: 15-07-2021 a las 08:31:17.
Responder Con Cita
  #6  
Antiguo 15-07-2021
Avatar de Eric Mtz
Eric Mtz Eric Mtz is offline
Miembro
 
Registrado: jun 2021
Ubicación: Vitoria-Gasteiz
Posts: 43
Poder: 0
Eric Mtz Va por buen camino
Función CRC en C#

¡Buenos días gente!, ya que el señor Jaiser está recopilando funciones para el cálculo de CRC en distintos lenguajes aporto la solución en C#, ¡Fijo que a alguien le será de utilidad!

Código:
        private static byte[] crc8_table = new byte[] {
         (byte) 0x00, (byte) 0x07, (byte) 0x0E, (byte) 0x09, (byte) 0x1C, (byte) 0x1B, (byte) 0x12, (byte) 0x15,
         (byte) 0x38, (byte) 0x3F, (byte) 0x36, (byte) 0x31, (byte) 0x24, (byte) 0x23, (byte) 0x2A, (byte) 0x2D,
         (byte) 0x70, (byte) 0x77, (byte) 0x7E, (byte) 0x79, (byte) 0x6C, (byte) 0x6B, (byte) 0x62, (byte) 0x65,
         (byte) 0x48, (byte) 0x4F, (byte) 0x46, (byte) 0x41, (byte) 0x54, (byte) 0x53, (byte) 0x5A, (byte) 0x5D,
         (byte) 0xE0, (byte) 0xE7, (byte) 0xEE, (byte) 0xE9, (byte) 0xFC, (byte) 0xFB, (byte) 0xF2, (byte) 0xF5,
         (byte) 0xD8, (byte) 0xDF, (byte) 0xD6, (byte) 0xD1, (byte) 0xC4, (byte) 0xC3, (byte) 0xCA, (byte) 0xCD,
         (byte) 0x90, (byte) 0x97, (byte) 0x9E, (byte) 0x99, (byte) 0x8C, (byte) 0x8B, (byte) 0x82, (byte) 0x85,
         (byte) 0xA8, (byte) 0xAF, (byte) 0xA6, (byte) 0xA1, (byte) 0xB4, (byte) 0xB3, (byte) 0xBA, (byte) 0xBD,
         (byte) 0xC7, (byte) 0xC0, (byte) 0xC9, (byte) 0xCE, (byte) 0xDB, (byte) 0xDC, (byte) 0xD5, (byte) 0xD2,
         (byte) 0xFF, (byte) 0xF8, (byte) 0xF1, (byte) 0xF6, (byte) 0xE3, (byte) 0xE4, (byte) 0xED, (byte) 0xEA,
         (byte) 0xB7, (byte) 0xB0, (byte) 0xB9, (byte) 0xBE, (byte) 0xAB, (byte) 0xAC, (byte) 0xA5, (byte) 0xA2,
         (byte) 0x8F, (byte) 0x88, (byte) 0x81, (byte) 0x86, (byte) 0x93, (byte) 0x94, (byte) 0x9D, (byte) 0x9A,
         (byte) 0x27, (byte) 0x20, (byte) 0x29, (byte) 0x2E, (byte) 0x3B, (byte) 0x3C, (byte) 0x35, (byte) 0x32,
         (byte) 0x1F, (byte) 0x18, (byte) 0x11, (byte) 0x16, (byte) 0x03, (byte) 0x04, (byte) 0x0D, (byte) 0x0A,
         (byte) 0x57, (byte) 0x50, (byte) 0x59, (byte) 0x5E, (byte) 0x4B, (byte) 0x4C, (byte) 0x45, (byte) 0x42,
         (byte) 0x6F, (byte) 0x68, (byte) 0x61, (byte) 0x66, (byte) 0x73, (byte) 0x74, (byte) 0x7D, (byte) 0x7A,
         (byte) 0x89, (byte) 0x8E, (byte) 0x87, (byte) 0x80, (byte) 0x95, (byte) 0x92, (byte) 0x9B, (byte) 0x9C,
         (byte) 0xB1, (byte) 0xB6, (byte) 0xBF, (byte) 0xB8, (byte) 0xAD, (byte) 0xAA, (byte) 0xA3, (byte) 0xA4,
         (byte) 0xF9, (byte) 0xFE, (byte) 0xF7, (byte) 0xF0, (byte) 0xE5, (byte) 0xE2, (byte) 0xEB, (byte) 0xEC,
         (byte) 0xC1, (byte) 0xC6, (byte) 0xCF, (byte) 0xC8, (byte) 0xDD, (byte) 0xDA, (byte) 0xD3, (byte) 0xD4,
         (byte) 0x69, (byte) 0x6E, (byte) 0x67, (byte) 0x60, (byte) 0x75, (byte) 0x72, (byte) 0x7B, (byte) 0x7C,
         (byte) 0x51, (byte) 0x56, (byte) 0x5F, (byte) 0x58, (byte) 0x4D, (byte) 0x4A, (byte) 0x43, (byte) 0x44,
         (byte) 0x19, (byte) 0x1E, (byte) 0x17, (byte) 0x10, (byte) 0x05, (byte) 0x02, (byte) 0x0B, (byte) 0x0C,
         (byte) 0x21, (byte) 0x26, (byte) 0x2F, (byte) 0x28, (byte) 0x3D, (byte) 0x3A, (byte) 0x33, (byte) 0x34,
         (byte) 0x4E, (byte) 0x49, (byte) 0x40, (byte) 0x47, (byte) 0x52, (byte) 0x55, (byte) 0x5C, (byte) 0x5B,
         (byte) 0x76, (byte) 0x71, (byte) 0x78, (byte) 0x7F, (byte) 0x6A, (byte) 0x6D, (byte) 0x64, (byte) 0x63,
         (byte) 0x3E, (byte) 0x39, (byte) 0x30, (byte) 0x37, (byte) 0x22, (byte) 0x25, (byte) 0x2C, (byte) 0x2B,
         (byte) 0x06, (byte) 0x01, (byte) 0x08, (byte) 0x0F, (byte) 0x1A, (byte) 0x1D, (byte) 0x14, (byte) 0x13,
         (byte) 0xAE, (byte) 0xA9, (byte) 0xA0, (byte) 0xA7, (byte) 0xB2, (byte) 0xB5, (byte) 0xBC, (byte) 0xBB,
         (byte) 0x96, (byte) 0x91, (byte) 0x98, (byte) 0x9F, (byte) 0x8A, (byte) 0x8D, (byte) 0x84, (byte) 0x83,
         (byte) 0xDE, (byte) 0xD9, (byte) 0xD0, (byte) 0xD7, (byte) 0xC2, (byte) 0xC5, (byte) 0xCC, (byte) 0xCB,
         (byte) 0xE6, (byte) 0xE1, (byte) 0xE8, (byte) 0xEF, (byte) 0xFA, (byte) 0xFD, (byte) 0xF4, (byte) 0xF3
        };

        private static String CalcularCRC(String input)
        {
            byte[] data = Encoding.UTF8.GetBytes(input);
            int len = data.Length;
            byte crc = 0;

            for (int i = 0; i < len; i++)
            {
                crc = crc8_table[(crc ^ data[i]) & 0xff];
            }

            long a = (crc & 0xFFL);

            return a.ToString("D3");
        }

Pd: Quizás deberíamos de plantear el crear un repositorio donde todos podamos aportar código y compartir el dolor de cabeza, que actualmente estamos todos sufriendo en silencio topándonos con los mismos problemas.
Responder Con Cita
  #7  
Antiguo 15-07-2021
edari edari is offline
Miembro
 
Registrado: jun 2021
Posts: 334
Poder: 6
edari Va por buen camino
Cita:
Empezado por Eric Mtz Ver Mensaje
¡Buenos días gente!, ya que el señor Jaiser está recopilando funciones para el cálculo de CRC en distintos lenguajes aporto la solución en C#, ¡Fijo que a alguien le será de utilidad!

Código:
        private static byte[] crc8_table = new byte[] {
         (byte) 0x00, (byte) 0x07, (byte) 0x0E, (byte) 0x09, (byte) 0x1C, (byte) 0x1B, (byte) 0x12, (byte) 0x15,
         (byte) 0x38, (byte) 0x3F, (byte) 0x36, (byte) 0x31, (byte) 0x24, (byte) 0x23, (byte) 0x2A, (byte) 0x2D,
         (byte) 0x70, (byte) 0x77, (byte) 0x7E, (byte) 0x79, (byte) 0x6C, (byte) 0x6B, (byte) 0x62, (byte) 0x65,
         (byte) 0x48, (byte) 0x4F, (byte) 0x46, (byte) 0x41, (byte) 0x54, (byte) 0x53, (byte) 0x5A, (byte) 0x5D,
         (byte) 0xE0, (byte) 0xE7, (byte) 0xEE, (byte) 0xE9, (byte) 0xFC, (byte) 0xFB, (byte) 0xF2, (byte) 0xF5,
         (byte) 0xD8, (byte) 0xDF, (byte) 0xD6, (byte) 0xD1, (byte) 0xC4, (byte) 0xC3, (byte) 0xCA, (byte) 0xCD,
         (byte) 0x90, (byte) 0x97, (byte) 0x9E, (byte) 0x99, (byte) 0x8C, (byte) 0x8B, (byte) 0x82, (byte) 0x85,
         (byte) 0xA8, (byte) 0xAF, (byte) 0xA6, (byte) 0xA1, (byte) 0xB4, (byte) 0xB3, (byte) 0xBA, (byte) 0xBD,
         (byte) 0xC7, (byte) 0xC0, (byte) 0xC9, (byte) 0xCE, (byte) 0xDB, (byte) 0xDC, (byte) 0xD5, (byte) 0xD2,
         (byte) 0xFF, (byte) 0xF8, (byte) 0xF1, (byte) 0xF6, (byte) 0xE3, (byte) 0xE4, (byte) 0xED, (byte) 0xEA,
         (byte) 0xB7, (byte) 0xB0, (byte) 0xB9, (byte) 0xBE, (byte) 0xAB, (byte) 0xAC, (byte) 0xA5, (byte) 0xA2,
         (byte) 0x8F, (byte) 0x88, (byte) 0x81, (byte) 0x86, (byte) 0x93, (byte) 0x94, (byte) 0x9D, (byte) 0x9A,
         (byte) 0x27, (byte) 0x20, (byte) 0x29, (byte) 0x2E, (byte) 0x3B, (byte) 0x3C, (byte) 0x35, (byte) 0x32,
         (byte) 0x1F, (byte) 0x18, (byte) 0x11, (byte) 0x16, (byte) 0x03, (byte) 0x04, (byte) 0x0D, (byte) 0x0A,
         (byte) 0x57, (byte) 0x50, (byte) 0x59, (byte) 0x5E, (byte) 0x4B, (byte) 0x4C, (byte) 0x45, (byte) 0x42,
         (byte) 0x6F, (byte) 0x68, (byte) 0x61, (byte) 0x66, (byte) 0x73, (byte) 0x74, (byte) 0x7D, (byte) 0x7A,
         (byte) 0x89, (byte) 0x8E, (byte) 0x87, (byte) 0x80, (byte) 0x95, (byte) 0x92, (byte) 0x9B, (byte) 0x9C,
         (byte) 0xB1, (byte) 0xB6, (byte) 0xBF, (byte) 0xB8, (byte) 0xAD, (byte) 0xAA, (byte) 0xA3, (byte) 0xA4,
         (byte) 0xF9, (byte) 0xFE, (byte) 0xF7, (byte) 0xF0, (byte) 0xE5, (byte) 0xE2, (byte) 0xEB, (byte) 0xEC,
         (byte) 0xC1, (byte) 0xC6, (byte) 0xCF, (byte) 0xC8, (byte) 0xDD, (byte) 0xDA, (byte) 0xD3, (byte) 0xD4,
         (byte) 0x69, (byte) 0x6E, (byte) 0x67, (byte) 0x60, (byte) 0x75, (byte) 0x72, (byte) 0x7B, (byte) 0x7C,
         (byte) 0x51, (byte) 0x56, (byte) 0x5F, (byte) 0x58, (byte) 0x4D, (byte) 0x4A, (byte) 0x43, (byte) 0x44,
         (byte) 0x19, (byte) 0x1E, (byte) 0x17, (byte) 0x10, (byte) 0x05, (byte) 0x02, (byte) 0x0B, (byte) 0x0C,
         (byte) 0x21, (byte) 0x26, (byte) 0x2F, (byte) 0x28, (byte) 0x3D, (byte) 0x3A, (byte) 0x33, (byte) 0x34,
         (byte) 0x4E, (byte) 0x49, (byte) 0x40, (byte) 0x47, (byte) 0x52, (byte) 0x55, (byte) 0x5C, (byte) 0x5B,
         (byte) 0x76, (byte) 0x71, (byte) 0x78, (byte) 0x7F, (byte) 0x6A, (byte) 0x6D, (byte) 0x64, (byte) 0x63,
         (byte) 0x3E, (byte) 0x39, (byte) 0x30, (byte) 0x37, (byte) 0x22, (byte) 0x25, (byte) 0x2C, (byte) 0x2B,
         (byte) 0x06, (byte) 0x01, (byte) 0x08, (byte) 0x0F, (byte) 0x1A, (byte) 0x1D, (byte) 0x14, (byte) 0x13,
         (byte) 0xAE, (byte) 0xA9, (byte) 0xA0, (byte) 0xA7, (byte) 0xB2, (byte) 0xB5, (byte) 0xBC, (byte) 0xBB,
         (byte) 0x96, (byte) 0x91, (byte) 0x98, (byte) 0x9F, (byte) 0x8A, (byte) 0x8D, (byte) 0x84, (byte) 0x83,
         (byte) 0xDE, (byte) 0xD9, (byte) 0xD0, (byte) 0xD7, (byte) 0xC2, (byte) 0xC5, (byte) 0xCC, (byte) 0xCB,
         (byte) 0xE6, (byte) 0xE1, (byte) 0xE8, (byte) 0xEF, (byte) 0xFA, (byte) 0xFD, (byte) 0xF4, (byte) 0xF3
        };

        private static String CalcularCRC(String input)
        {
            byte[] data = Encoding.UTF8.GetBytes(input);
            int len = data.Length;
            byte crc = 0;

            for (int i = 0; i < len; i++)
            {
                crc = crc8_table[(crc ^ data[i]) & 0xff];
            }

            long a = (crc & 0xFFL);

            return a.ToString("D3");
        }
Pd: Quizás deberíamos de plantear el crear un repositorio donde todos podamos aportar código y compartir el dolor de cabeza, que actualmente estamos todos sufriendo en silencio topándonos con los mismos problemas.





Porque lo que es imposible es calcular el crc desde cmd con un comando al estilo del autofirmacommandline.exe al que le puedas pasar los parámetros de manera externa, verdad?



Mi lenguaje tiene complicado llamar a dll externas y recuperar como parámetro el resultado y me estoy volviendo un poco gilipichis para encontrar la manera
Responder Con Cita
  #8  
Antiguo 15-07-2021
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is online now
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.459
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por edari Ver Mensaje
Porque lo que es imposible es calcular el crc desde cmd con un comando al estilo del autofirmacommandline.exe al que le puedas pasar los parámetros de manera externa, verdad?

Mi lenguaje tiene complicado llamar a dll externas y recuperar como parámetro el resultado y me estoy volviendo un poco gilipichis para encontrar la manera

Mírate este mensaje del hilo, a ver si te sirve:
http://clubdelphi.com/foros/showpost...&postcount=606
También puedes hacerlo directamente en un EXE si te es más útil.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #9  
Antiguo 15-07-2021
tejano tejano is offline
Miembro
 
Registrado: dic 2020
Posts: 132
Poder: 6
tejano Va por buen camino
Cita:
Empezado por edari Ver Mensaje
Porque lo que es imposible es calcular el crc desde cmd con un comando al estilo del autofirmacommandline.exe al que le puedas pasar los parámetros de manera externa, verdad?



Mi lenguaje tiene complicado llamar a dll externas y recuperar como parámetro el resultado y me estoy volviendo un poco gilipichis para encontrar la manera
Hola Edari, yo he encontrado un programa en Java que por línea de comando te deja el archivo dónde tu quieras y luego es leer el contenido de ese archivo

java -jar c:\amis\exes\crc8.jar -a crc8 -q "txt:CODIGO_TBAI" -F #CHECKSUM >archivo_destino

Si te interesa te paso el programa
Responder Con Cita
  #10  
Antiguo 15-07-2021
edari edari is offline
Miembro
 
Registrado: jun 2021
Posts: 334
Poder: 6
edari Va por buen camino
Cita:
Empezado por tejano Ver Mensaje
Hola Edari, yo he encontrado un programa en Java que por línea de comando te deja el archivo dónde tu quieras y luego es leer el contenido de ese archivo

java -jar c:\amis\exes\crc8.jar -a crc8 -q "txt:CODIGO_TBAI" -F #CHECKSUM >archivo_destino

Si te interesa te paso el programa



Me interesa porque he estado mirando la otra opción del amigo neftali y me da la sensación de que no puedo pasarle el código por parámetro sino que se me para en cada uno de ellos para pedirme y darme el resultado, lo cual no me es muy práctico porque en mi proceso normal una empresa puede imprimir de una tacada 300 facturas seguidas y necesito buscar algo más como lo que me dices tú.
Responder Con Cita
  #11  
Antiguo 15-07-2021
tejano tejano is offline
Miembro
 
Registrado: dic 2020
Posts: 132
Poder: 6
tejano Va por buen camino
Cita:
Empezado por edari Ver Mensaje
Me interesa porque he estado mirando la otra opción del amigo neftali y me da la sensación de que no puedo pasarle el código por parámetro sino que se me para en cada uno de ellos para pedirme y darme el resultado, lo cual no me es muy práctico porque en mi proceso normal una empresa puede imprimir de una tacada 300 facturas seguidas y necesito buscar algo más como lo que me dices tú.
Creo que va adjunto
Archivos Adjuntos
Tipo de Archivo: zip crc8.zip (178,2 KB, 19 visitas)
Responder Con Cita
  #12  
Antiguo 15-07-2021
Avatar de b4aronDeLaBirr4
b4aronDeLaBirr4 b4aronDeLaBirr4 is offline
Miembro
 
Registrado: jul 2021
Posts: 67
Poder: 6
b4aronDeLaBirr4 Va por buen camino
Siempre al pie del cañón, Eric jeje a mí me viene genial! Y lo del repositorio no es mala idea, porque las funciones al fin y al cabo son siempre las mismas pero con distinto lenguaje.
Responder Con Cita
  #13  
Antiguo 15-07-2021
Galaxian Galaxian is offline
Miembro
 
Registrado: mar 2021
Posts: 52
Poder: 6
Galaxian Va por buen camino
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje


Y el IDOtro:

¡No me digas que tienes una herramienta que analiza XSD!

¡LA QUIERO! ¡PORFI, PORFI, PORFI...
Responder Con Cita
  #14  
Antiguo 15-07-2021
jaiser jaiser is offline
Miembro
 
Registrado: abr 2021
Posts: 18
Poder: 0
jaiser Va por buen camino
Cita:
Empezado por skatologiko Ver Mensaje
A Guipuzcoa. Si envío un NIF español, sí que llega

<Destinatarios>
<IDDestinatario>
<NIF>NL855820627B01</NIF>
<ApellidosNombreRazonSocial>ITX MERKEN B.V.</ApellidosNombreRazonSocial>
</IDDestinatario>
</Destinatarios>

Y me da el siguiente error:
Error: El fichero de alta TicketBAI no cumple el esquema XSD. Detalle del error: cvc-pattern-valid: Value 'NL855820627B01' is not facet-valid with respect to pattern '(([a-z|A-Z]{1}\d{7}[a-z|A-Z]{1})|(\d{8}[a-z|A-Z]{1})|([a-z|A-Z]{1}\d{8}))' for type 'NIFType'.</Descripcion>
Para nif extranjeros tienes que indicar que nif o documentación estás poniendo por ejemplo asi, donde el 04 es Documento oficial de identificaci`´on expedido por el pais o territorio de residendcia.
las opciones que puedes poner son :
02 nif-iva
03 pasaporte
04 Documento oficial de identificaci`´on expedido por el pais o territorio de residencia.
05 Certificado de residencia
06 Otro documento probatorio

<Destinatarios>
<IDDestinatario>
<IDOtro>
<IDType>04</IDType>
<ID>nif_empresa_extranjero</ID>
</IDOtro>
<ApellidosNombreRazonSocial>nombre_razonsocial_empresa.</ApellidosNombreRazonSocial>
<Direccion />
</IDDestinatario>
</Destinatarios>
Responder Con Cita
  #15  
Antiguo 15-07-2021
Galaxian Galaxian is offline
Miembro
 
Registrado: mar 2021
Posts: 52
Poder: 6
Galaxian Va por buen camino
Cita:
Empezado por skatologiko Ver Mensaje
A Guipuzcoa. Si envío un NIF español, sí que llega

<Destinatarios>
<IDDestinatario>
<NIF>NL855820627B01</NIF>
<ApellidosNombreRazonSocial>ITX MERKEN B.V.</ApellidosNombreRazonSocial>
</IDDestinatario>
</Destinatarios>

Y me da el siguiente error:
Error: El fichero de alta TicketBAI no cumple el esquema XSD. Detalle del error: cvc-pattern-valid: Value 'NL855820627B01' is not facet-valid with respect to pattern '(([a-z|A-Z]{1}\d{7}[a-z|A-Z]{1})|(\d{8}[a-z|A-Z]{1})|([a-z|A-Z]{1}\d{8}))' for type 'NIFType'.</Descripcion>
Para los destinatarios extranjeros tiene que usar la definición "IDOtroType" del XSD
Responder Con Cita
  #16  
Antiguo 22-07-2021
unomasmas unomasmas is offline
Miembro
 
Registrado: dic 2019
Posts: 194
Poder: 7
unomasmas Va por buen camino
Cita:
Empezado por skatologiko Ver Mensaje
A Guipuzcoa. Si envío un NIF español, sí que llega

<Destinatarios>
<IDDestinatario>
<NIF>NL855820627B01</NIF>
<ApellidosNombreRazonSocial>ITX MERKEN B.V.</ApellidosNombreRazonSocial>
</IDDestinatario>
</Destinatarios>

Y me da el siguiente error:
Error: El fichero de alta TicketBAI no cumple el esquema XSD. Detalle del error: cvc-pattern-valid: Value 'NL855820627B01' is not facet-valid with respect to pattern '(([a-z|A-Z]{1}\d{7}[a-z|A-Z]{1})|(\d{8}[a-z|A-Z]{1})|([a-z|A-Z]{1}\d{8}))' for type 'NIFType'.</Descripcion>

Ese NIF no es español. Creo que debes detallarlo así:
<Destinatarios>
<IDDestinatario>
<IDOtro>
<IDType>04 (o el que corresponda)</IDType>
<ID>NL855820627B01</ID>
</IDOtro>
<ApellidosNombreRazonSocial>ITX MERKEN B.V.</ApellidosNombreRazonSocial>
</IDDestinatario>
</Destinatarios>

Valores posibles para IDType:
02 NIF-IVA.
03 Pasaporte.
04 Documento oficial de identificación expedido por el país o territorio de residencia.
05 Certificado de residencia.
06 Otro documento probatorio.
Responder Con Cita
  #17  
Antiguo 22-07-2021
unomasmas unomasmas is offline
Miembro
 
Registrado: dic 2019
Posts: 194
Poder: 7
unomasmas Va por buen camino
Question Enviar Alta a Gipuzkoa (en pruebas)

Tengo problemas para subir el fichero de alta TicketBAI al entorno de pruebas de Gipuzkoa. No entiendo muy bien qué está ocurriendo. Estoy haciendo el script en C#. En los diferentes métodos que he empleado me ocurren dos tipos de problema:

[Problema 1:]
Código:
        <ResultadosValidacion>
            <Codigo>002</Codigo>
            <Descripcion>Error: El fichero de alta TicketBAI no cumple el esquema XSD. No se ha podido procesar el mensaje. Detalle del error: Content is not allowed in prolog.</Descripcion>
            <Azalpena>Errorea: TicketBAI altako fitxategiak ez du betetzen XSD eskema. Mezua ezin da prozesatu. Errorearen xehetasuna: Content is not allowed in prolog.</Azalpena>
        </ResultadosValidacion>
Este es el código utilizado:
Código:
            string urlconexion = "h t t p s://tbai-prep.egoitza.gipuzkoa.eus/WAS/HACI/HTBRecepcionFacturasWEB/rest/recepcionFacturas/alta";
            string file = @"D:\Datos_Desarrollo\tBAI\6936.XSIG";
            var client = new RestClient(urlconexion);
            client.ClientCertificates = new X509CertificateCollection() { certificate };
            var restrequest = new RestRequest(Method.POST);
            restrequest.AddHeader("Content-Type", "application/xml;charset=UTF-8");
            restrequest.AddFile("mifichero", file, "text/xml");
            IRestResponse response = client.Execute(restrequest);
            System.Diagnostics.Debug.WriteLine(response.Content);
RestClient y RestRequest son clases de RestSharp
IRestResponse es un contenedor de RestSharp que recoge la respuesta del servidor.
certificate es una instancia de la clase X509Certificate2 de System.Security.Cryptography.X509Certificates


[Problema 2:]
Código:
        <ResultadosValidacion>
            <Codigo>007</Codigo>
            <Descripcion>Error: Certificado remitente no válido para emisor factura.</Descripcion>
            <Azalpena>Errorea: Bidaltzailearen ziurtagiria ez da baliagarria fakturaren egilearentzat.</Azalpena>
        </ResultadosValidacion>
Este es el código utilizado:
Código:
            string urlconexion =  "h t t p s://tbai-prep.egoitza.gipuzkoa.eus/WAS/HACI/HTBRecepcionFacturasWEB/rest/recepcionFacturas/alta";
            string file = @"D:\Datos_Desarrollo\tBAI\6936.XSIG";
            HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(urlconexion);
            wr.ContentType = "application/xml;charset=UTF-8";
            wr.Method = "POST";
            wr.ClientCertificates = new X509CertificateCollection() { certificate };
            Stream rs = wr.GetRequestStream();
            rs = wr.GetRequestStream();
            FileStream fileStream = new FileStream(file, FileMode.Open, FileAccess.Read);
            byte[] buffer = new byte[4096];
            int bytesRead = 0;
            while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)
            {
                rs.Write(buffer, 0, bytesRead);
            }
            WebResponse wresp = null;
            try
            {
                wresp = wr.GetResponse();
                Stream stream2 = wresp.GetResponseStream();
                StreamReader reader2 = new StreamReader(stream2);
                System.Diagnostics.Debug.WriteLine(reader2.ReadToEnd());
            }
HttpWebRequest se incluye en System.Net
certificate es igualmente una instancia de la clase X509Certificate2 de System.Security.Cryptography.X509Certificates
Me imagino que en este segundo caso el problema puede estar en la manipulación del fichero (por haberlo subido como stream) pero no veo cómo comprobarlo. Si alguien me pudiera echar una mano se lo agradecería tanto como el tiempo que llevo tratando de encontrar una solución (un mogollón). Gracias ya por haberme leido.

Última edición por unomasmas fecha: 22-07-2021 a las 23:51:58. Razón: Mejorar la visibilidad del código insertado
Responder Con Cita
  #18  
Antiguo 23-07-2021
Avatar de b4aronDeLaBirr4
b4aronDeLaBirr4 b4aronDeLaBirr4 is offline
Miembro
 
Registrado: jul 2021
Posts: 67
Poder: 6
b4aronDeLaBirr4 Va por buen camino
Buenas!

Yo también estoy desarrollando la solución en C# así que a ver si algo te puedo ayudar...
En primer lugar, si podrías postear el fichero XML que envías y que también me dijeras qué certificado estás usando. Cabe recordar que el orden de los elementos en el XML es importante que sea acorde al XSD y que la petición de alta al servicio la estés realizando con el certificado también (además de firmar con él), aunque veo que sí, podrías probar en POSTMAN previamente o algo. Yo hice esto para ir descartando estos errores, te lo recomiendo. Por cierto, cómo estás firmando el XML? (Esto ya porque a mí me interesa ver otras opciones jeje)

Un saludo.
Responder Con Cita
  #19  
Antiguo 23-07-2021
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is online now
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.459
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por unomasmas Ver Mensaje
... me ocurren dos tipos de problema:

<Descripcion>Error: El fichero de alta TicketBAI no cumple el esquema XSD. No se ha podido procesar el mensaje. Detalle del error: Content is not allowed in prolog.</Descripcion>

<Descripcion>Error: Certificado remitente no válido para emisor factura.</Descripcion>
Para el primero, ¿puedes poner el fichero que estás enviando?
Lo digo por compararlo con otros.
También puedes comprar tú mismo la estructura del que estás enviando con algunos de los ejemplos que hay en los mensajes del foro o los que te puedes descargar, a ver si te estás olvidando algún nodo (ya no sólo de los datos, sino de las firmas,...)

En cuanto al segundo, si revisas mensajes anteriores ya hemos hablado de él también. El certificado debe ser válido (de producción por decirelo así), no valen certificados de prueba.
¿Qué tipo de certificado estás utilizando?

También puedes escribirles un mail con el fichero que estás enviando y los errores que te dan; Para el primer caso te dirán qué te falta y para el segundo caso, te darán de alta el certificado (si es necesario) y lo asociarán a los datos que estás usando para el envío (NIF / RAZON SOCIAL).
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #20  
Antiguo 23-07-2021
unomasmas unomasmas is offline
Miembro
 
Registrado: dic 2019
Posts: 194
Poder: 7
unomasmas Va por buen camino
Cita:
Empezado por b4aronDeLaBirr4 Ver Mensaje
podrías postear el fichero XML que envías
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
¿puedes poner el fichero que estás enviando?
Es un poco tocho :-(. Ahí va. He cambiado/quitado algún dato para "anonimizarlo" pero la estructura se mantiene
Código:
<?xml version="1.0" encoding="utf-8"?>
<T:TicketBai xmlns:T="urn:ticketbai:emision">
   <Cabecera>
      <IDVersionTBAI>1.2</IDVersionTBAI>
   </Cabecera>
   <Sujetos>
      <Emisor>
         <NIF>xxxxxxxxx</NIF>
         <ApellidosNombreRazonSocial>Empresa para Desarrollo</ApellidosNombreRazonSocial>
      </Emisor>
      <Destinatarios>
         <IDDestinatario>
            <IDOtro>
               <CodigoPais>DE</CodigoPais>
               <IDType>03</IDType>
               <ID>U85XXXXX</ID>
            </IDOtro>
            <ApellidosNombreRazonSocial>CLIENTE</ApellidosNombreRazonSocial>
            <CodigoPostal>28036</CodigoPostal>
            <Direccion>C/ Inexistente. Madrid. ESP</Direccion>
         </IDDestinatario>
      </Destinatarios>
      <VariosDestinatarios>N</VariosDestinatarios>
      <EmitidaPorTercerosODestinatario>N</EmitidaPorTercerosODestinatario>
   </Sujetos>
   <Factura>
      <CabeceraFactura>
         <SerieFactura>2021-</SerieFactura>
         <NumFactura>0008</NumFactura>
         <FechaExpedicionFactura>27-05-2021</FechaExpedicionFactura>
         <HoraExpedicionFactura>00:00:00</HoraExpedicionFactura>
         <FacturaSimplificada>N</FacturaSimplificada>
         <FacturaEmitidaSustitucionSimplificada>N</FacturaEmitidaSustitucionSimplificada>
      </CabeceraFactura>
      <DatosFactura>
         <FechaOperacion>27-05-2021</FechaOperacion>
         <DescripcionFactura></DescripcionFactura>
         <DetallesFactura>
            <IDDetalleFactura>
               <DescripcionDetalle>Un servicio</DescripcionDetalle>
               <Cantidad>1.00</Cantidad>
               <ImporteUnitario>2000.00000000</ImporteUnitario>
               <Descuento>0.00</Descuento>
               <ImporteTotal>2420.00</ImporteTotal>
            </IDDetalleFactura>
            <IDDetalleFactura>
               <DescripcionDetalle>Producto 1</DescripcionDetalle>
               <Cantidad>1.00</Cantidad>
               <ImporteUnitario>5.83710987</ImporteUnitario>
               <Descuento>1.17</Descuento>
               <ImporteTotal>5.65</ImporteTotal>
            </IDDetalleFactura>
            <IDDetalleFactura>
               <DescripcionDetalle>Producto 2</DescripcionDetalle>
               <Cantidad>1.00</Cantidad>
               <ImporteUnitario>2363.79000000</ImporteUnitario>
               <Descuento>756.41</Descuento>
               <ImporteTotal>1944.93</ImporteTotal>
            </IDDetalleFactura>
            <IDDetalleFactura>
               <DescripcionDetalle>Producto 3 (Exento)</DescripcionDetalle>
               <Cantidad>1.00</Cantidad>
               <ImporteUnitario>200.00000000</ImporteUnitario>
               <Descuento>0.00</Descuento>
               <ImporteTotal>200.00</ImporteTotal>
            </IDDetalleFactura>
            <IDDetalleFactura>
               <DescripcionDetalle>Producto 4 (No sujeto)</DescripcionDetalle>
               <Cantidad>1.00</Cantidad>
               <ImporteUnitario>400.00000000</ImporteUnitario>
               <Descuento>0.00</Descuento>
               <ImporteTotal>400.00</ImporteTotal>
            </IDDetalleFactura>
            <IDDetalleFactura>
               <DescripcionDetalle>Producto 5</DescripcionDetalle>
               <Cantidad>1.00</Cantidad>
               <ImporteUnitario>79.80172200</ImporteUnitario>
               <Descuento>15.96</Descuento>
               <ImporteTotal>77.25</ImporteTotal>
            </IDDetalleFactura>
         </DetallesFactura>
         <ImporteTotalFactura>4543.04</ImporteTotalFactura>
         <RetencionSoportada>0.00</RetencionSoportada>
         <Claves>
            <IDClave>
               <ClaveRegimenIvaOpTrascendencia>01</ClaveRegimenIvaOpTrascendencia>
            </IDClave>
         </Claves>
      </DatosFactura>
      <TipoDesglose>
         <DesgloseTipoOperacion>
            <PrestacionServicios>
               <Sujeta>
                  <NoExenta>
                     <DetalleNoExenta>
                           <TipoNoExenta>S1</TipoNoExenta>
                           <DesgloseIVA>
                              <DetalleIVA>
                                 <BaseImponible>1800.00</BaseImponible>
                                 <TipoImpositivo>21.00</TipoImpositivo>
                                 <CuotaImpuesto>378.00</CuotaImpuesto>
                                 <TipoRecargoEquivalencia>0.00</TipoRecargoEquivalencia>
                                 <CuotaRecargoEquivalencia>0.00</CuotaRecargoEquivalencia>
                                 <OperacionEnRecargoDeEquivalenciaORegimenSimplificado>N</OperacionEnRecargoDeEquivalenciaORegimenSimplificado>
                              </DetalleIVA>
                           </DesgloseIVA>
                     </DetalleNoExenta>
                  </NoExenta>
               </Sujeta>
            </PrestacionServicios>
            <Entrega>
               <Sujeta>
                  <Exenta>
                     <DetalleExenta>
                        <CausaExencion>E1</CausaExencion>
                        <BaseImponible>180.00</BaseImponible>
                     </DetalleExenta>
                  </Exenta>
                  <NoExenta>
                     <DetalleNoExenta>
                           <TipoNoExenta>S1</TipoNoExenta>
                           <DesgloseIVA>
                              <DetalleIVA>
                                 <BaseImponible>1508.30</BaseImponible>
                                 <TipoImpositivo>21.00</TipoImpositivo>
                                 <CuotaImpuesto>316.74</CuotaImpuesto>
                                 <TipoRecargoEquivalencia>0.00</TipoRecargoEquivalencia>
                                 <CuotaRecargoEquivalencia>0.00</CuotaRecargoEquivalencia>
                                 <OperacionEnRecargoDeEquivalenciaORegimenSimplificado>N</OperacionEnRecargoDeEquivalenciaORegimenSimplificado>
                              </DetalleIVA>
                           </DesgloseIVA>
                     </DetalleNoExenta>
                  </NoExenta>
               </Sujeta>
               <NoSujeta>
                  <DetalleNoSujeta>
                     <Causa>OT</Causa>
                     <Importe>360.00</Importe>
                  </DetalleNoSujeta>
               </NoSujeta>
            </Entrega>
         </DesgloseTipoOperacion>
      </TipoDesglose>
   </Factura>
   <HuellaTBAI>
      <EncadenamientoFacturaAnterior>
         <SerieFacturaAnterior>2021-</SerieFacturaAnterior>
         <NumFacturaAnterior>0007</NumFacturaAnterior>
         <FechaExpedicionFacturaAnterior>13-03-2021</FechaExpedicionFacturaAnterior>
         <SignatureValueFirmaFacturaAnterior>asdf</SignatureValueFirmaFacturaAnterior>
      </EncadenamientoFacturaAnterior>
      <Software>
      </Software>
   </HuellaTBAI>
<ds:Signature xmlns:ds="h t t p://w w w . w3.org/2000/09/xmldsig#" Id="Signature-de680881-c7b4-47c6-aba5-6587d516d7f8"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="h t t p://w w w . w3.org/TR/2001/REC-xml-c14n-20010315" /><ds:SignatureMethod Algorithm="h t t p://w w w . w3.org/2001/04/xmldsig-more#rsa-sha256" /><ds:Reference Id="Reference-1fd8f7a2-64b2-4853-be4d-6d09a5f4acf8" URI=""><ds:Transforms><ds:Transform Algorithm="h t t p://w w w . w3.org/2000/09/xmldsig#enveloped-signature" /></ds:Transforms><ds:DigestMethod Algorithm="h t t p://w w w . w3.org/2001/04/xmlenc#sha256" /><ds:DigestValue>o1QqNl5sJpAl65C/BqAYVhusYNSi6ohFRmcOlj/XvS0=</ds:DigestValue></ds:Reference><ds:Reference Id="ReferenceKeyInfo" URI="#KeyInfoId-Signature-de680881-c7b4-47c6-aba5-6587d516d7f8"><ds:DigestMethod Algorithm="h t t p://w w w . w3.org/2001/04/xmlenc#sha256" /><ds:DigestValue>9Ot9CoT4axGDWrd2B2KUoiGUM9dotSbXN7VTW1ZSEzg=</ds:DigestValue></ds:Reference><ds:Reference Type="h t t p://uri.etsi.org/01903#SignedProperties" URI="#SignedProperties-Signature-de680881-c7b4-47c6-aba5-6587d516d7f8"><ds:DigestMethod Algorithm="h t t p://w w w . w3.org/2001/04/xmlenc#sha256" /><ds:DigestValue>ou5WE9zmPnbJIGd/8a1PdT8yjojsvnRHQL5mU/CUB6Y=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue Id="SignatureValue-de680881-c7b4-47c6-aba5-6587d516d7f8">ndpqqvNMKU7TLGzTuFaA34shuQMMV6D8i18U21wxr4uPVCOh79W6ws9Uaf/9v2xLeAJG0Xuxb7Tun5akz6v+lw/JthiulnG23G8No7FARMBi3/JvqPfWQT/3dZs/858JQRg5qOBSxy1UiXHrgHk8mwzAw8PqvmJX+Ah9RsBM9nHmvDW/Ezj+D6SgTinwUbe5AgxZ2FCubMpEf4BA0oBmkNgno4Gu62huvYYcm/XTfzuBgJsPWmF8Y2AB3YlMEZBqdZT7uSJYFoYLbku26UV8WQU9eQbErxFPI+3eiqqq+g0cKlq0mYmeQms9NAjWjJyOEYAZy6noD1OxghMzhsmbWw==</ds:SignatureValue><ds:KeyInfo Id="KeyInfoId-Signature-de680881-c7b4-47c6-aba5-6587d516d7f8"><ds:X509Data><ds:X509Certificate>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</ds:X509Certificate></ds:X509Data><ds:KeyValue><ds:RSAKeyValue><ds:Modulus>qqnHp05M8zTtA1mOGyn52Zg2MxIdVoq0i+nq1UBsyD0YTbDvrFxorop1lVmwD9zFcU7g97YYHzUh6ZKzrDBxRR5DuEj7ZWxmM8zdrUE4qj4RPaEn56yBspcfsXAnAElWhi8ZO6upkdwezKplh0sIv9rC3yVEmenUA+t3vpjvUjuVI83M8E2OmlO9wspX7oAagyG86X79QLoUCiMNaklhtts/bAhjaUf1NjiByA1oVJ/h5vPXRmjzIMSYOG4Nqx6oDS4EDjzodr9qWWR/rO/y8pAANFvhPviGC30oLEDU9QeImrYt9hLRHiI3Z3f+k8bthyY/NHw97LARgkl46UkQOQ==</ds:Modulus><ds:Exponent>AQAB</ds:Exponent></ds:RSAKeyValue></ds:KeyValue></ds:KeyInfo><ds:Object Id="XadesObjectId-57c1a5af-ffe1-461d-88df-f9eff65f7ae3"><xades:QualifyingProperties xmlns:xades="h t t p://uri.etsi.org/01903/v1.3.2#" Id="QualifyingProperties-1175f181-69af-4b92-89cd-01f8370fc991" Target="#Signature-de680881-c7b4-47c6-aba5-6587d516d7f8"><xades:SignedProperties Id="SignedProperties-Signature-de680881-c7b4-47c6-aba5-6587d516d7f8"><xades:SignedSignatureProperties><xades:SigningTime>2021-07-22T07:25:38+02:00</xades:SigningTime><xades:SigningCertificate><xades:Cert><xades:CertDigest><ds:DigestMethod Algorithm="h t t p://w w w . w3.org/2001/04/xmlenc#sha256" /><ds:DigestValue>4BZFYhzQCbqva/Vw8wyM2GXhf8lML3xaiMioujojtqQ=</ds:DigestValue></xades:CertDigest><xades:IssuerSerial><ds:X509IssuerName>CN=AC FNMT Usuarios, OU=Ceres, O=FNMT-RCM, C=ES</ds:X509IssuerName><ds:X509SerialNumber>348708523848XXXXXXXXXXXX13XX4566539550</ds:X509SerialNumber></xades:IssuerSerial></xades:Cert></xades:SigningCertificate><xades:SignaturePolicyIdentifier><xades:SignaturePolicyId><xades:SigPolicyId><xades:Identifier>h t t p://ticketbai.eus/politicafirma</xades:Identifier><xades:Description /></xades:SigPolicyId><xades:SigPolicyHash><ds:DigestMethod Algorithm="h t t p://w w w . w3.org/2000/09/xmldsig#sha1" /><ds:DigestValue>Ohixl6upD6av8N7pEvDABhEL6hM=</ds:DigestValue></xades:SigPolicyHash></xades:SignaturePolicyId></xades:SignaturePolicyIdentifier><xades:SignerRole><xades:ClaimedRoles><xades:ClaimedRole>emisor</xades:ClaimedRole><xades:ClaimedRole>sujeto</xades:ClaimedRole><xades:ClaimedRole>SERIALNUMBER</xades:ClaimedRole></xades:ClaimedRoles></xades:SignerRole></xades:SignedSignatureProperties><xades:SignedDataObjectProperties><xades:DataObjectFormat ObjectReference="#Reference-1fd8f7a2-64b2-4853-be4d-6d09a5f4acf8"><xades:MimeType>text/xml</xades:MimeType><xades:Encoding>UTF-8</xades:Encoding></xades:DataObjectFormat></xades:SignedDataObjectProperties></xades:SignedProperties></xades:QualifyingProperties></ds:Object></ds:Signature></T:TicketBai>
Cita:
Empezado por b4aronDeLaBirr4 Ver Mensaje
qué certificado estás usando
Uso mi certificado personal, de la FNMT
Cita:
Empezado por b4aronDeLaBirr4 Ver Mensaje
el orden de los elementos en el XML es importante que sea acorde al XSD
Esto está revisado. Con la segunda opción me dió algunos errores de no concordancia con el XSD que corregí, así que aquí no creo que haya problema.
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
El certificado debe ser válido (de producción por decirelo así), no valen certificados de prueba. ¿Qué tipo de certificado estás utilizando?
Cita:
Empezado por b4aronDeLaBirr4 Ver Mensaje
que la petición de alta al servicio la estés realizando con el certificado también (además de firmar con él)
Creo que aquí está el problema (para el segúndo método). Para el envío no usaba el certificado del alta en el servicio ¡Gracias!
Cita:
Empezado por b4aronDeLaBirr4 Ver Mensaje
podrías probar en POSTMAN previamente o algo. Yo hice esto para ir descartando estos errores, te lo recomiendo.
No lo he usado nunca. Le echaré un vistazo. Gracias.
Cita:
Empezado por b4aronDeLaBirr4 Ver Mensaje
Por cierto, cómo estás firmando el XML? (Esto ya porque a mí me interesa ver otras opciones jeje)
Lo firmo con la librería FirmaXadesNet del Ayuntamiento de Cartagena (h t t p s://w w w . administracionelectronica.gob.es/ctt/firmaxadesnet). No hay documentación para ella pero en el código fuente (que también puedes descargar) tienes ejemplos de uso. Si quieres probarla (si no la usas ya) y no te aclaras, puedo poner el borrador que tengo para la firma; es más: lo pongo ya:
Código:
        public void FirmaDoc()
        {
            XadesService xadesService = new XadesService();
            SignatureParameters parametros = new SignatureParameters();
            parametros.SignaturePolicyInfo = new SignaturePolicyInfo();
            parametros.SignaturePolicyInfo.PolicyIdentifier = "h t t p://ticketbai.eus/politicafirma";
            parametros.SignaturePolicyInfo.PolicyHash = "Ohixl6upD6av8N7pEvDABhEL6hM=";
            parametros.SignaturePackaging = SignaturePackaging.ENVELOPED;
            parametros.DataFormat = new DataFormat();
            parametros.DataFormat.MimeType = "text/xml";
            parametros.SignerRole = new SignerRole();
            parametros.SignerRole.ClaimedRoles.Add("emisor");
            System.Security.Cryptography.X509Certificates.X509Certificate2 certificado;
            certificado = FirmaXadesNet.Utils.CertUtil.SelectCertificate();
            using (parametros.Signer = new Signer(certificado))
            {
                using (FileStream fs = new FileStream(_ficheroXml, FileMode.Open))
                {
                    SignatureDocument documentoFirma = xadesService.Sign(fs, parametros);
                    documentoFirma.Save(Path.Combine(Path.GetDirectoryName(_ficheroXml), Path.GetFileNameWithoutExtension(_ficheroXml) + ".XSIG"));
                    MessageBox.Show("Fichero guardado correctamente.");
                }
            }
        }
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
También puedes comprar tú mismo la estructura del que estás enviando con algunos de los ejemplos que hay en los mensajes del foro o los que te puedes descargar, a ver si te estás olvidando algún nodo (ya no sólo de los datos, sino de las firmas,...)
La verdad es que he mirado para ver si veía ejemplos (sobre todo de firmas) y no he visto nada más que algunas líneas sueltas... :-(
Cita:
Empezado por Neftali [Germán.Estévez] Ver Mensaje
También puedes escribirles un mail con el fichero que estás enviando y los errores que te dan; Para el primer caso te dirán qué te falta y para el segundo caso, te darán de alta el certificado (si es necesario) y lo asociarán a los datos que estás usando para el envío (NIF / RAZON SOCIAL).
Gracias Neftalí. Voy a hacerlo también para ver si resuelvo el primer caso. El segundo con tus aportaciones y las de b4aronDeLaBirr4 creo que está resuelto. He hecho una subida tras cambiar el certificado de firma y ahora el error da pie a entender que ¡sí ha funcionado!. Este es el resultado:
Código:
        <ResultadosValidacion>
            <Codigo>005</Codigo>
            <Descripcion>Error: Fichero de alta TicketBAI ya registrado en el sistema.</Descripcion>
            <Azalpena>Errorea: TicketBAI fitxategia sisteman erregistratuta dago jada.</Azalpena>
        </ResultadosValidacion>
Probaré con otro documento y os cuento.
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
SII -Nuevo sistema de la Agencia Tributaria española de envío de datos vía Webservice newtron Internet 3716 19-01-2026 20:01:34
Como utilizar la ayuda del nuevo Sistema Operativo gluglu Humor 3 24-09-2007 09:39:05
Aplicacion Agencia De Viajes ArdiIIa Varios 9 20-01-2007 16:49:53
El Vasco Aguirre Al González La Taberna 5 26-05-2006 09:22:28
Microsoft ha lanzado su nuevo sistema operativo DarkByte Humor 0 25-01-2004 09:21:14


La franja horaria es GMT +2. Ahora son las 17:21:32.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi