Hola Paquito, muchas gracias por tu ayuda.
He enviado el xml tal y como lo pones tu para también me diera errores pero la respuesta no coincide, no me da errores :
Consola de envio :
Code: Select all | Expand
curl\bin\curl -k --connect-timeout 60 -m 300 -s -S -L --header "Content-Type: text/xml;charset=UTF-8" --cert "empresa.pem" --key "empresa_key.pem" --data 1.xml --output respuesta.xml https://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP -v
* Host prewww1.aeat.es:443 was resolved.
* IPv6: (none)
* IPv4: 195.77.198.76
* Trying 195.77.198.76:443...
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
} [310 bytes data]
* TLSv1.3 (IN), TLS handshake, Server hello (2):
{ [87 bytes data]
* TLSv1.2 (IN), TLS handshake, Certificate (11):
{ [4208 bytes data]
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
{ [461 bytes data]
* TLSv1.2 (IN), TLS handshake, Request CERT (13):
{ [16652 bytes data]
* TLSv1.2 (IN), TLS handshake, Server finished (14):
{ [4 bytes data]
* TLSv1.2 (OUT), TLS handshake, Certificate (11):
} [2263 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
} [70 bytes data]
* TLSv1.2 (OUT), TLS handshake, CERT verify (15):
} [264 bytes data]
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
} [1 bytes data]
* TLSv1.2 (OUT), TLS handshake, Finished (20):
} [16 bytes data]
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
{ [1 bytes data]
* TLSv1.2 (IN), TLS handshake, Finished (20):
{ [16 bytes data]
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256 / [blank] / UNDEF
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
* subject: C=ES; L=Madrid; O=Agencia Estatal de Administración Tributaria; CN=*.aeat.es
* start date: Oct 23 08:43:06 2023 GMT
* expire date: Nov 23 08:43:05 2024 GMT
* issuer: C=US; O=Entrust, Inc.; OU=See http://www.entrust.net/legal-terms; OU=(c) 2012 Entrust, Inc. - for authorized use only; CN=Entrust Certification Authority - L1K
* SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.
* Certificate level 0: Public key type ? (3072/128 Bits/secBits), signed using sha256WithRSAEncryption
* Certificate level 1: Public key type ? (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Certificate level 2: Public key type ? (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
* Connected to prewww1.aeat.es (195.77.198.76) port 443
* using HTTP/1.x
> POST /wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP HTTP/1.1
> Host: prewww1.aeat.es
> User-Agent: curl/8.10.1
> Accept: */*
> Content-Type: text/xml;charset=UTF-8
> Content-Length: 5
>
} [5 bytes data]
* upload completely sent off: 5 bytes
< HTTP/1.1 200 OK
< content-type: text/xml;charset=UTF-8
< dit-niu: 46020459447
< content-length: 5751
< dit-tarea: 83
< dit-servidor: WLP00402
< dit-idpeticion: 20241021130842330026
< date: Mon, 21 Oct 2024 11:08:42 GMT
< x-ua-compatible: IE=7
< set-cookie: CERT_WWW1=C8188F941BF5E0D2A9555722BCABDB69341583C526E5EE05383AF6F1F0DC599397A00C518F4836DE2A9B0D8EB487C2631EE11ABC63080482087821292D1F46B94C34115264A99FB92774379AF3BC72C58AE5832BNJX5XEpFv/iBRHx/mf/pI71ZXtlp1bXh4yHs/US6p5rNVKcbQx8D3ZRQwhn+lySalfxvhgzWbgBau+3fy6FlI3pwQtM+o/we/XJEhpleXidDP821CButgkJValRCaC+TWIOYwTvraRKrw4lNyMC/wY0eXVen+CwuO1puc8KIFiDdyADifIO4FT/W6fcJ518hcPcGoQloVloiEE/oHyTNjkhzCkKh5IkOQhm5Oou8kg4oQ51GSqB4Xv69e03sXoNOPZyzVGcJl1eL9Zk1QdzU9xwv6uITqWfP500dUiy36sLdBiYEa3zR1IceLZs0TbnOGTqwfC5RldSPEdFVSn+7ibvs618eJOtyujQQtGjLaCwTDlkMJ3gzPMWVPdEVJHrHj/8Yf5T1V7LVorvq1l4yHoX/hYKkI0rap5+Cr14gEsZeUZf20nsRommtUUnck1j3XA==; Domain=.aeat.es; Path=/; HttpOnly; Secure
< set-cookie: CERT_WWW1V=20241021-12384232; Domain=.aeat.es; Path=/; Secure
< set-cookie: sgat_id_usr_sede=%7B%22tipoAcceso%22%3A%22C%22%2C%22fechaYHora%22%3A%2220241021130842330%22%2C%22nombre%22%3A%22MAN%20SOFT%20COMPUTER%20SL%22%7D; Domain=.aeat.es; Path=/; Secure
< dit-codigo-respuesta: 0
< content-language: es-ES
< expires: Thu, 01 Dec 1994 16:00:00 GMT
< cache-control: no-cache="set-cookie, set-cookie2"
< x-site: Sede
< referrer-policy: strict-origin-when-cross-origin
< x-xss-protection: 1; mode=block
< strict-transport-security: max-age=31536000; includeSubDomains
< content-security-policy: frame-ancestors 'self' *.aeat.es
<
{ [2514 bytes data]
* Connection #0 to host prewww1.aeat.es left intact
Respuesta fichero xml:
Code: Select all | Expand
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><env:Fault><faultcode>env:Client</faultcode><faultstring>Codigo[1304].El contenido no está permitido en el prólogo. (1,1)</faultstring><detail><callstack>XML no válido o mal formado
WSExcepcion [faultcode=null, detailMap=null, version=0, faultstring=El contenido no está permitido en el prólogo. (1,1), faultactor=null, faultSubCode=null, reasonText=null, detail=null, nameSpaceUriDetail=null]
at es.aeat.adws.jdit.imp.ws.WSFilterSrvImpl.verificarFirma(WSFilterSrvImpl.java:845)
at es.aeat.adws.jdit.imp.ws.WSFilterSrvImpl.doFilter(WSFilterSrvImpl.java:225)
at es.aeat.adws.jdit.api.ws.WSFilter.doFilter(WSFilter.java:24)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93)
at es.aeat.adht.jdit.imp.infra.JDitFilterSrvImpl.filtroIni(JDitFilterSrvImpl.java:288)
at es.aeat.adht.jdit.imp.infra.JDitFilterSrvImpl.doFilter(JDitFilterSrvImpl.java:101)
at es.aeat.adht.jdit.imp.infra.JDitFilterSrvImpl.doFilter(JDitFilterSrvImpl.java:74)
at es.aeat.adht.jdit.api.filter.JDitFilter.doFilter(JDitFilter.java:24)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:203)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:1069)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1260)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5096)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:328)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1047)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:293)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1260)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:476)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:435)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:569)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:503)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:363)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:330)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:169)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:77)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:516)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:586)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:970)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1059)
at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:280)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: es.aeat.adws.jdit.api.xml.XmlExcepcion: El contenido no está permitido en el prólogo. (1,1)
at es.aeat.adws.jdit.imp.xml.DomUtilsSrvImpl.isToDoc(DomUtilsSrvImpl.java:87)
at es.aeat.adws.jdit.imp.xml.DomUtilsSrvImpl.isToDoc(DomUtilsSrvImpl.java:53)
at es.aeat.adws.jdit.imp.ws.WSFilterSrvImpl.verificarFirma(WSFilterSrvImpl.java:773)
... 33 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; El contenido no está permitido en el prólogo.
at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at java.xml/javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at es.aeat.adws.jdit.imp.xml.DomUtilsSrvImpl.isToDoc(DomUtilsSrvImpl.java:83)
... 35 more
</callstack></detail></env:Fault></env:Body></env:Envelope>
Algo no tengo bien o no estoy haciendo bien, porque me da el mismo error que con el xml que te envie.
¿Alguna idea o prueba que pueda hacer?