![]() |
![]() |
| 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
|
|||
|
|||
|
Los ejemplos son perfectos, era yo que la estaba liando al motar el xml!!!!
, ya he conseguido que me responda Muchas gracias por vuestra ayuda!!! |
|
#2
|
|||
|
|||
|
Le he pedido a la IA que me pase el código y me saca ésto.. Ni idea de si es correcto.
uses System.Net.HttpClient, System.Net.HttpClientComponent, System.JSON, System.SysUtils, System.Classes, Vcl.Dialogs; procedure CheckVAT; var CountryCode, VatNumber, Url: string; HttpClient: THTTPClient; Response: IHTTPResponse; JsonValue: TJSONValue; JSONObject: TJSONObject; IsValid: Boolean; Name, Address, ErrorMsg: string; begin CountryCode := 'LU'; // Ej. 'ES', 'DE', etc. VatNumber := '20260743'; Url := Format('https://ec.europa.eu/taxation_customs/vies/rest-api/ms/%s/vat/%s', [CountryCode, VatNumber]); HttpClient := THTTPClient.Create; try Response := HttpClient.Get(Url); if Response.StatusCode = 200 then begin JsonValue := TJSONObject.ParseJSONValue(Response.ContentAsString); if Assigned(JsonValue) then begin JSONObject := JsonValue as TJSONObject; IsValid := JSONObject.GetValue<Boolean>('isValid'); if IsValid then begin Name := JSONObject.GetValue<string>('name'); Address := JSONObject.GetValue<string>('address').Replace('\n', sLineBreak); ShowMessage('VAT válido.' + sLineBreak + 'Nombre: ' + Name + sLineBreak + 'Dirección: ' + Address); end else begin ErrorMsg := JSONObject.GetValue<string>('userError'); ShowMessage('VAT no válido. Mensaje: ' + ErrorMsg); end; end; end else ShowMessage('Error HTTP: ' + Response.StatusCode.ToString); except on E: Exception do ShowMessage('Excepción: ' + E.Message); end; HttpClient.Free; end; |
|
#3
|
||||
|
||||
|
Cita:
Estupendo |
|
#4
|
|||
|
|||
|
Puedes poner wl xml que pasas ahora, por que a mi me funcionaba antes y ya no
|
|
#5
|
|||
|
|||
|
Cita:
Código:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:Datos="urn:ec.europa.eu:taxud:vies:services:checkVat:types">
<soapenv:Body>
<Datos:checkVat>
<Datos:countryCode>DE</Datos:countryCode>
<Datos:vatNumber>813518999</Datos:vatNumber>
</Datos:checkVat>
</soapenv:Body>
</soapenv:Envelope>
|
|
#6
|
|||
|
|||
|
Gracias, antes funcionaba, se ve que han metido un control nuevo en la solicitud y ya no vale por defecto enviarle el xml y hay que decir si envias json o xml:
Cita:
Cita:
|
|
#7
|
||||
|
||||
|
Yo les paso estos Headers.
hServidor.Request.CustomHeaders.AddValue('Accept', '*/*'); hServidor.Request.CustomHeaders.AddValue('Accept-Encoding', 'identify'); hServidor.Request.CustomHeaders.AddValue('Charset', 'utf-8'); hServidor.Request.CustomHeaders.AddValue('Content-Type', 'text/xml'); hServidor.Request.CustomHeaders.AddValue('Connection', 'keep-alive'); hServidor.Request.CustomHeaders.AddValue('SOAPAction', 'checkVatService'); |
|
#8
|
|||
|
|||
|
Hola de nuevo,
Puede ser que este tipo de clientes intracomunitarios (y supongo que también los extra...) Verifactu trague todos los "cifes" sin validar nada aunque lo tengas como PASAPORTE, DOCUMENTO PAIS DE ORIGEN, CERTIFICADO DE RESIDENCIA, OTRO DOCUMENTO PROBATORIO ? Un saludo |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Verificación de RUC Peru. | F3niX | Varios | 7 | 26-05-2017 04:36:50 |
| Rutina de verificacion de campos | JosepMiquel | Varios | 3 | 08-12-2007 19:43:19 |
| Búsqueda sin imagen de verificación | kuan-yiu | La Taberna | 8 | 13-11-2007 18:22:10 |
| Verificación de los datos grabados en CD o DVD | rretamar | API de Windows | 24 | 16-01-2007 06:32:47 |
| Verificación de dni | luna | Varios | 4 | 29-05-2004 21:33:46 |
|