![]() |
![]() |
![]() |
![]() |
![]() |
FTP | ![]() |
![]() |
CCD | ![]() |
![]() |
Buscar | ![]() |
![]() |
Trucos | ![]() |
![]() |
Trabajo | ![]() |
![]() |
Foros | ![]() |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
Consulta DBF
Buenas tardes, no sé si alguien puede decirme que estoy haciendo mal a la hora de mandar el XML a la DBF. El XML es correcto y gzip también
Adjunto en envío que he hecho con el comando curl y la respuesta de la DBF. El error creo que está aquí "* Mark bundle as not supporting multiuse" curl --cert certificado.pem --key clave_certificado.pem -H "Content-Type:application/json" -H "Accept-Encoding=gzip" -H "Content-Encoding=gzip" -H "Content-Length=534" -H "Content-Type=application/octet-stream" -H "eus-bizkaia-n3-version=1.0" -H "eus-bizkaia-n3-content-type=application/xml" -H "eus-bizkaia-n3-data"={"con":"LROE","apa":"1.1","inte":{"nif":"A48190839","nrs":"TECNICAS_DE_REFRACTARIOS_SAU"},"drs ":{"mode":"240","ejer":"2021"}} -X POST -v https://pruesarrerak.bizkaia.eus/N3B4001M/kontsulta -d data=c:\tmp\consulta.gz --output c:\tmp\respuesta.txt Note: Unnecessary use of -X or --request, POST is already inferred. % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 80.245.2.232:443... * Connected to pruesarrerak.bizkaia.eus (80.245.2.232) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: c:\curl\1\bin\curl-ca-bundle.crt * CApath: none } [5 bytes data] * TLSv1.3 (OUT), TLS handshake, Client hello (1): } [512 bytes data] 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* TLSv1.3 (IN), TLS handshake, Server hello (2): { [81 bytes data] * TLSv1.2 (IN), TLS handshake, Certificate (11): { [4450 bytes data] * TLSv1.2 (IN), TLS handshake, Server key exchange (12): { [527 bytes data] * TLSv1.2 (IN), TLS handshake, Request CERT (13): { [36 bytes data] * TLSv1.2 (IN), TLS handshake, Server finished (14): { [4 bytes data] * TLSv1.2 (OUT), TLS handshake, Certificate (11): } [2210 bytes data] * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): } [134 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 handshake, Finished (20): { [16 bytes data] * SSL connection using TLSv1.2 / DHE-RSA-AES256-GCM-SHA384 * ALPN, server did not agree to a protocol * Server certificate: * subject: jurisdictionC=ES; jurisdictionST=BIZKAIA; jurisdictionL=BILBAO; businessCategory=Government Entity; postalCode=48009; C=ES; ST=BIZKAIA; L=BILBAO; street=GRAN VÍA 25; O=BIZKAIKO FORU ALDUNDIA - DIPUTACION FORAL DE BIZKAIA; OU=IT; serialNumber=P4800000D; CN=pruesarrerak.bizkaia.eus * start date: Jul 3 12:41:06 2020 GMT * expire date: Jul 3 12:41:06 2022 GMT * subjectAltName: host "pruesarrerak.bizkaia.eus" matched cert's "pruesarrerak.bizkaia.eus" * issuer: C=ES; O=IZENPE S.A.; OU=BZ Ziurtagiri publikoa - Certificado publico EV; CN=CA de Certificados SSL EV * SSL certificate verify ok. } [5 bytes data] > POST /N3B4001M/kontsulta HTTP/1.1 > Host: pruesarrerak.bizkaia.eus > User-Agent: curl/7.73.0 > Accept: */* > Content-Type:application/json > eus-bizkaia-n3-data={con:LROE,apa:1.1,inte:{nif:A48190839,nrs:TECNICAS_DE_REFRACTARIOS_SAU},drs:{mode:240,ejer:2021 }} > Content-Length: 23 > } [23 bytes data] * upload completely sent off: 23 out of 23 bytes { [5 bytes data] * Mark bundle as not supporting multiuse < HTTP/1.1 400 Bad Request < Date: Tue, 01 Jun 2021 15:32:31 GMT < Content-Length: 226 < Connection: close < Content-Type: text/html; charset=iso-8859-1 < Set-Cookie: TS0171c831=0147f0636e5196e806220013a9ac432d8ddb6b0939537abc2a9c686853ccc6150ba84f4e4e510f66131b57d88 8b4728c8c1c3b5923; Path=/ < { [226 bytes data] 100 249 100 226 100 23 784 79 --:--:-- --:--:-- --:--:-- 864 * Closing connection 0 } [5 bytes data] * TLSv1.2 (OUT), TLS alert, close notify (256): } [2 bytes data A quien pueda decirme dónde falla, se lo agradeceré para siempre. Saludos |
#2
|
|||
|
|||
Prueba a cambiar en las cabeceras el "=" por ": " (dos puntos)
-H "Content-Encoding=gzip" -> -H "Content-Encoding: gzip" ... y posiblemente esto así: -H "eus-bizkaia-n3-data: {\"con\":\"LROE\",\"apa\":\"1.1\",\"inte\":{\"nif\":\"A48190839\",\"nrs\":\"TECNICAS_DE_REFRACTARIOS _SAU\"},\"drs\":{\"mode\":\"240\",\"ejer\":\"2021\"}}" o asi: -H 'eus-bizkaia-n3-data: {"con":"LROE","apa":"1.1","inte":{"nif":"A48190839","nrs":"TECNICAS_DE_REFRACTARIOS_SAU"},"drs ":{"mode":"240","ejer":"2021"}}' Cita:
Última edición por sline fecha: 01-06-2021 a las 17:59:31. |
#3
|
|||
|
|||
A alguien que se le ocurra algo, se queda colgado en este punto * upload completely sent off: 23 out of 23 bytes
100 23 0 0 0 23 0 0 --:--:-- 0:03:51 --:--:-- 0 He descargado el certificado de pruebas/producción, pero aún así nada. Si se utiliza este certificado hay que cambiar el CIF/Razón social en la llamada? C:\tmp>curl --cert-type P12 --cert c:\amis\exes\sello_entidad_act.p12:IZProd2021 -H "Content-Type:application/json" -H "Accept-Encoding:gzip" -H "Content-Encoding:gzip" -H "Content-Length:534" -H "Content-Type:application/octet-stream" -H "eus-bizkaia-n3-version:1.0" -H "eus-bizkaia-n3-content-type:application/xml" -H "eus-bizkaia-n3-data:{\"con\":\"LROE\",\"apa\":\"1.1\",\"inte\":{\"nif\":\"A48190839\",\"nrs\":\"TECNICAS DE REFRACTARIOS S.A.U\"},\"drs\":{\"mode\":\"240\",\"ejer\":\"2021\"}}" -v https://pruesarrerak.bizkaia.eus/N3B4001M/kontsulta -d data:c:\tmp\consulta.gz --output c:\tmp\respuesta.xml % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 80.245.2.232... * TCP_NODELAY set * Connected to pruesarrerak.bizkaia.eus (80.245.2.232) port 443 (#0) * schannel: SSL/TLS connection with pruesarrerak.bizkaia.eus port 443 (step 1/3) * schannel: checking server certificate revocation * schannel: sending initial handshake data: sending 195 bytes... * schannel: sent initial handshake data: sent 195 bytes * schannel: SSL/TLS connection with pruesarrerak.bizkaia.eus port 443 (step 2/3) * schannel: failed to receive handshake, need more data 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* schannel: SSL/TLS connection with pruesarrerak.bizkaia.eus port 443 (step 2/3) * schannel: encrypted data got 4096 * schannel: encrypted data buffer: offset 4096 length 4096 * schannel: encrypted data length: 4010 * schannel: encrypted data buffer: offset 4010 length 4096 * schannel: received incomplete message, need more data * schannel: SSL/TLS connection with pruesarrerak.bizkaia.eus port 443 (step 2/3) * schannel: encrypted data got 1024 * schannel: encrypted data buffer: offset 5034 length 5034 * schannel: encrypted data length: 6 * schannel: encrypted data buffer: offset 6 length 5034 * schannel: received incomplete message, need more data * schannel: SSL/TLS connection with pruesarrerak.bizkaia.eus port 443 (step 2/3) * schannel: encrypted data got 3 * schannel: encrypted data buffer: offset 9 length 5034 * schannel: sending next handshake data: sending 4433 bytes... * schannel: SSL/TLS connection with pruesarrerak.bizkaia.eus port 443 (step 2/3) * schannel: encrypted data got 51 * schannel: encrypted data buffer: offset 51 length 5034 * schannel: SSL/TLS handshake complete * schannel: SSL/TLS connection with pruesarrerak.bizkaia.eus port 443 (step 3/3) * schannel: stored credential handle in session cache > POST /N3B4001M/kontsulta HTTP/1.1 > Host: pruesarrerak.bizkaia.eus > User-Agent: curl/7.55.1 > Accept: */* > Content-Type:application/json > Accept-Encoding:gzip > Content-Encoding:gzip > Content-Length:534 > Content-Type:application/octet-stream > eus-bizkaia-n3-version:1.0 > eus-bizkaia-n3-content-type:application/xml > eus-bizkaia-n3-data:{"con":"LROE","apa":"1.1","inte":{"nif":"A48190839","nrs":"TECNICAS DE REFRACTARIOS S.A.U"},"drs":{"mode":"240","ejer":"2021"}} > } [23 bytes data] * upload completely sent off: 23 out of 23 bytes 100 23 0 0 0 23 0 0 --:--:-- 0:03:51 --:--:-- 0 Graciassssss |
#4
|
|||
|
|||
Cita:
* No pongas -H "Content-Type:application/json" (sólo -H "Content-Type:application/octet-stream") * En lugar del signo igual =, pon dos puntos : * En el Json escapa las dobles comillas (\") * -H "Content-Length=534" no es necesario, cURL envía el Content-Lenght automáticamente * La barra baja en la Razon Social no es necesaria Un saludo |
#5
|
|||
|
|||
Cita:
Otra cuestion, los comprimidos son datos binarios así que envia el gzip de esta manera --data-bynary @c:\tmp\consulta.gz |
![]() |
|
|
![]() |
||||
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 | 3706 | Hace 2 Semanas 09:38:43 |
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 |
![]() |
|