![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
||||
|
||||
|
Cita:
Sobretodo ahora que aveces responden el nuevo campo type vacio y da error. |
|
#2
|
|||
|
|||
|
Cita:
Gracias |
|
#3
|
|||
|
|||
|
Me apunto a la explicacion
|
|
#4
|
|||
|
|||
|
si trabajais con Delphi, en el componente HTTPRIO que hace el envío, evento OnAfterExecute:
ahí os guarda la respuesta en la ruta que indiquéis |
|
#5
|
|||
|
|||
|
Sabéis si han cambiado algo respecto al calculo de la huella digital. ???
De repente me dice que no coincide. esto es lo que indica la respuesta de AEAT DescripcionErrorRegistro>El cálculo de la huella suministrada es incorrecta. Datos de entrada cálculo huella: IDEmisorFactura=33461360V&NumSerieFactura=02-2024-13784&FechaExpedicionFactura=21-10-2024&TipoFactura=F1&CuotaTotal=1.81&ImporteTotal=10.45&Huella=C0E0A0F622EFF0A77A41E4 7C13972AEAB8E05A85E81D6B873942238A1A670BC5&FechaHoraHusoGenRegistro=2024-10-22T11:15:05+02:00 Huella calculada: 12EB4A6836E721DB0737F03A04EBDFF73D35B3A3D097F549548F00A259C65AFD |
|
#6
|
||||
|
||||
|
Cita:
Cita:
Hola, he implementado esta funcion , si la de aeat da error de serializacion o otro no interpretable uso esta. Código:
/// <summary>
/// Envio del registro de la factura a la aeat
/// </summary>
/// <param name="facAPresentar">Registro creado con las funciones de la aeat.</param>
/// <param name="action">Accion a realizar por defecto registro alta</param>
/// <returns>Devuelve la respuesta completa de la aeat</returns>
public string consultaAEAT(RegFactuSistemaFacturacion facAPresentar,string action = "RegistroAlta")
{
XmlSerializer serializaFactura = new XmlSerializer(typeof(RegFactuSistemaFacturacion));
string facXml = "";
using (var xmlw = new StringWriter())
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.Encoding = Encoding.UTF8;
using (XmlWriter writter = XmlWriter.Create(xmlw, settings))
{
serializaFactura.Serialize(writter, facAPresentar);
facXml = xmlw.ToString();
}
}
facXml = facXml.Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"> <soapenv:Header /> <soapenv:Body >");
facXml = facXml.Replace("<RegFactuSistemaFacturacion xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">", "<RegFactuSistemaFacturacion xmlns=\"https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroLR.xsd\">");
//facXml = facXml.Replace("</SistemaInformatico>", "</SistemaInformatico> \r\n <FechaHoraHusoGenRegistro xmlns=\"https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd\">" + timeStamp +"</FechaHoraHusoGenRegistro>");
facXml = facXml + " </soapenv:Body> </soapenv:Envelope > ";
////////////////////////// <----- Prueba extraccion sin serializar
XmlDocument doc = new XmlDocument();
doc.LoadXml(facXml.Replace("utf-16", "utf-8"));
HttpWebRequest webRequest = CreateWebRequest("https://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP", action);
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
X509Certificate2 certificate = new X509Certificate2(Program.certificado, Program.passcertificado); //requiere estas variables globalescontienen el certificado y su clave
var tiempo = certificate.SubjectName;
if (certificate == null)
throw new ArgumentNullException(
"Certificate is null. Maybe serial number in configuration was wrong.");
if (certificate.NotAfter < DateTime.Now)
throw new ArgumentNullException(
$"Certificate is out of date. NotAfter: {certificate.NotAfter}.");
webRequest.ClientCertificates.Add(certificate);
using (Stream stream = webRequest.GetRequestStream())
{
doc.Save(stream);
}
HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
string statusDescription = response.StatusDescription;
Stream dataStream = response.GetResponseStream();
string responseFromServer;
using (StreamReader reader = new StreamReader(dataStream))
{
responseFromServer = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();
}
return responseFromServer;
//retorno = client.RegFactuSistemaFacturacion(facAPresentar);
}
|
|
#7
|
||||
|
||||
|
Cita:
Código:
/// <summary>
/// Crea la instancia WebRequest para enviar la petición
/// al web service de la AEAT.
/// </summary>
/// <param name="url">Url del web service.</param>
/// <param name="action">Acción del web service.</param>
/// <returns></returns>
private static HttpWebRequest CreateWebRequest(string url, string action)
{
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url);
webRequest.Headers.Add("SOAPAction", action);
webRequest.ContentType = "text/xml;charset=\"utf-8\"";
webRequest.Accept = "text/xml";
webRequest.Method = "POST";
return webRequest;
}
Código:
string retornoConsulta = consultaAEAT(facAPresentar); Última edición por bmfranky fecha: 22-10-2024 a las 14:08:16. |
|
#8
|
||||
|
||||
|
Cita:
|
|
#9
|
|||
|
|||
|
Buenos días a todos,
Estoy usuando el programa de ejemplo para probar de hacer envíos y, al recibir la respuesta, no soy capaz de convertirla correctamente a un objeto del tipo RespuestaBaseType. EL problema lo tengo al acceder a las líneas de respuesta. Con Length(RespuestaBaseType.RespuestaLinea) me devuelve 0, como si fuese un array vacío pero el xml recibido si que tiene líneas. Para ver la respuesta que recibo uso el código de pablog2k:
Estoy recibiendo el siguiente xml: Código:
<env:Envelope> <env:Header/> <env:Body Id="Body"> <tikR:RespuestaRegFactuSistemaFacturacion> <tikR:Cabecera> <tik:ObligadoEmision> <tik:NombreRazon>EMPRSA SL</tik:NombreRazon> <tik:NIF>NIFF</tik:NIF> </tik:ObligadoEmision> </tikR:Cabecera> <tikR:TiempoEsperaEnvio>60</tikR:TiempoEsperaEnvio> <tikR:EstadoEnvio>Incorrecto</tikR:EstadoEnvio> <tikR:RespuestaLinea> <tikR:IDFactura> <tik:IDEmisorFactura>NIFF</tik:IDEmisorFactura> <tik:NumSerieFactura>F240001</tik:NumSerieFactura> <tik:FechaExpedicionFactura>21-01-2024</tik:FechaExpedicionFactura> </tikR:IDFactura> <tikR:Operacion> <tik:TipoOperacion>Alta</tik:TipoOperacion> </tikR:Operacion> <tikR:EstadoRegistro>Incorrecto</tikR:EstadoRegistro> <tikR:CodigoErrorRegistro>1123</tikR:CodigoErrorRegistro> <tikR:DescripcionErrorRegistro>El formato del NIF es incorrecto.. NIF:NIFCLI1.</tikR:DescripcionErrorRegistro> </tikR:RespuestaLinea> <tikR:RespuestaLinea> <tikR:IDFactura> <tik:IDEmisorFactura>NIFF</tik:IDEmisorFactura> <tik:NumSerieFactura>F240002</tik:NumSerieFactura> <tik:FechaExpedicionFactura>22-01-2024</tik:FechaExpedicionFactura> </tikR:IDFactura> <tikR:Operacion> <tik:TipoOperacion>Alta</tik:TipoOperacion> </tikR:Operacion> <tikR:EstadoRegistro>Incorrecto</tikR:EstadoRegistro> <tikR:CodigoErrorRegistro>1123</tikR:CodigoErrorRegistro> <tikR:DescripcionErrorRegistro>El formato del NIF es incorrecto.. NIF:NIFCLI2.</tikR:DescripcionErrorRegistro> </tikR:RespuestaLinea> <tikR:RespuestaLinea> <tikR:IDFactura> <tik:IDEmisorFactura>NIFF</tik:IDEmisorFactura> <tik:NumSerieFactura>F240001</tik:NumSerieFactura> <tik:FechaExpedicionFactura>21-01-2024</tik:FechaExpedicionFactura> </tikR:IDFactura> <tikR:Operacion> <tik:TipoOperacion>Anulacion</tik:TipoOperacion> </tikR:Operacion> <tikR:EstadoRegistro>Incorrecto</tikR:EstadoRegistro> <tikR:CodigoErrorRegistro>1177</tikR:CodigoErrorRegistro> <tikR:DescripcionErrorRegistro> El valor de campo IdSistemaInformatico del bloque SistemaInformatico es incorrecto. </tikR:DescripcionErrorRegistro> </tikR:RespuestaLinea> <tikR:RespuestaLinea> <tikR:IDFactura> <tik:IDEmisorFactura>NIFF</tik:IDEmisorFactura> <tik:NumSerieFactura>F240003</tik:NumSerieFactura> <tik:FechaExpedicionFactura>22-01-2024</tik:FechaExpedicionFactura> </tikR:IDFactura> <tikR:Operacion> <tik:TipoOperacion>Alta</tik:TipoOperacion> </tikR:Operacion> <tikR:EstadoRegistro>Incorrecto</tikR:EstadoRegistro> <tikR:CodigoErrorRegistro>1123</tikR:CodigoErrorRegistro> <tikR:DescripcionErrorRegistro>El formato del NIF es incorrecto.. NIF:NIFCLI2.</tikR:DescripcionErrorRegistro> </tikR:RespuestaLinea> <tikR:RespuestaLinea> <tikR:IDFactura> <tik:IDEmisorFactura>NIFF</tik:IDEmisorFactura> <tik:NumSerieFactura>F240004</tik:NumSerieFactura> <tik:FechaExpedicionFactura>22-01-2024</tik:FechaExpedicionFactura> </tikR:IDFactura> <tikR:Operacion> <tik:TipoOperacion>Alta</tik:TipoOperacion> </tikR:Operacion> <tikR:EstadoRegistro>Incorrecto</tikR:EstadoRegistro> <tikR:CodigoErrorRegistro>1123</tikR:CodigoErrorRegistro> <tikR:DescripcionErrorRegistro>El formato del NIF es incorrecto.. NIF:NIFCLI2.</tikR:DescripcionErrorRegistro> </tikR:RespuestaLinea> <tikR:RespuestaLinea> <tikR:IDFactura> <tik:IDEmisorFactura>NIFF</tik:IDEmisorFactura> <tik:NumSerieFactura>F240005</tik:NumSerieFactura> <tik:FechaExpedicionFactura>22-01-2024</tik:FechaExpedicionFactura> </tikR:IDFactura> <tikR:Operacion> <tik:TipoOperacion>Alta</tik:TipoOperacion> </tikR:Operacion> <tikR:EstadoRegistro>Incorrecto</tikR:EstadoRegistro> <tikR:CodigoErrorRegistro>1123</tikR:CodigoErrorRegistro> <tikR:DescripcionErrorRegistro>El formato del NIF es incorrecto.. NIF:NIFCLI2.</tikR:DescripcionErrorRegistro> </tikR:RespuestaLinea> <tikR:RespuestaLinea> <tikR:IDFactura> <tik:IDEmisorFactura>NIFF</tik:IDEmisorFactura> <tik:NumSerieFactura>F240006</tik:NumSerieFactura> <tik:FechaExpedicionFactura>22-01-2024</tik:FechaExpedicionFactura> </tikR:IDFactura> <tikR:Operacion> <tik:TipoOperacion>Alta</tik:TipoOperacion> </tikR:Operacion> <tikR:EstadoRegistro>Incorrecto</tikR:EstadoRegistro> <tikR:CodigoErrorRegistro>1123</tikR:CodigoErrorRegistro> <tikR:DescripcionErrorRegistro>El formato del NIF es incorrecto.. NIF:NIFCLI2.</tikR:DescripcionErrorRegistro> </tikR:RespuestaLinea> </tikR:RespuestaRegFactuSistemaFacturacion> </env:Body> </env:Envelope> Muchas gracias! |
|
#10
|
|||
|
|||
|
duda
Hola buenas
Estoy recreando la aplicacion de verifactu que esta colgada en este foro pero en python y ahora estoy con la parte de enviar el certificado y un xml de prueba que genero a partir de un excel. El problema que tengo es que a la hora de enviar la facturas me sale este error HTTPSConnectionPool(host='prewww1.aeat.es', port=443): Max retries exceeded with url: /wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP (Caused by SSLError(SSLError(524297, '[SSL] PEM lib (_ssl.c:3895)'))) La cosa es que no se si puede ser porque al estar usando un certificado que genere yo con openssl y un xml pero sin las caracteristicas de verifactu me esta dando el error porque el server no acepta eso o es porque tengo que usar una URL diferente para pruebas. Muchas gracias |
|
#11
|
|||
|
|||
|
Estoy teniendo problemas con el calculo de la huella. He chequeado los datos que vienen en las instrucciones, con ejemplo y resultrado de datos incluido y todo correcto, pero no consigo coincidir con hacienda en el momento de calcular, me da :
El cálculo de la huella suministrada es incorrecta. Datos de entrada cálculo huella: IDEmisorFactura=33461360V&NumSerieFactura=107-2024-13783&FechaExpedicionFactura=21-10-2024&TipoFactura=F1&CuotaTotal=10.07&ImporteTotal=58.15&Huella=7F89287D674954888681E C947D1019EDD8C8D81248CD510AD768E668B526171C&FechaHoraHusoGenRegistro=2024-10-23T10:24:27+02:00 Huella calculada: 9800FA2F5E2B24ED9F0EE98C8174C78B8E97B1294D5F58E90E506E27B31133B4 Alguien podria calcularla con los datos entrada calculo huella que muestro mas arriba. Gracias |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Hijo de Informáticos | gluglu | Humor | 3 | 13-03-2007 11:05:35 |
| Adictos informaticos ... | Trigger | Humor | 2 | 11-10-2004 12:18:32 |
| Nosotros los Informáticos | Trigger | Humor | 1 | 10-10-2004 14:58:09 |
| Patrón de los Informáticos. | obiwuan | Varios | 20 | 10-09-2003 14:44:54 |
| Chistes Informaticos | jhonny | Humor | 2 | 11-08-2003 21:59:09 |
|