Ver Mensaje Individual
  #4  
Antiguo 10-03-2023
iMia iMia is offline
Miembro
 
Registrado: jul 2010
Posts: 141
Reputación: 14
iMia Va por buen camino
Cita:
Empezado por Casimiro Notevi Ver Mensaje
A lo mejor si pones una copia del xml para que le echemos un vistazo, si es posible.
Normalmente, por lo que he visto en algunos casos, es porque no está bien estructurado.
pues no tengo respuesta... ese es el problema...

Capturo la respuesta así:

Al httpRio asigno el evento OnAfterExecute y lo defino así...

Código Delphi [-]
procedure TMainForm.HTTPOnAfterExecute(const MethodName: string; SOAPResponse: TStream);
var
  ts: TStringList;
begin
    SOAPResponse.Position := 0;
    ts := TStringList.Create;
    try
      ts.LoadFromStream(SOAPResponse);
      SOAPResponse.Size := 0;
      SOAPResponse.Position := 0;
      ts.SaveToStream(SOAPResponse);
      ts.saveToFile(ExtractFilePath(Application.ExeName) + ChangeFileExt(ExtractFileName(Application.ExeName), '.debug.respuesta.txt'));
    finally
      ts.Free;
    end;
end;

pero siempre está vacío...

Edito:

Cuando responde todo va bien y sí llego a capturar el mensaje de restuesta

Código:
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><VNifV2Sal:VNifV2Sal xmlns:VNifV2Sal="http://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/burt/jdit/ws/VNifV2Sal.xsd"><VNifV2Sal:Contribuyente><VNifV2Sal:Nif>XXXXXX</VNifV2Sal:Nif><VNifV2Sal:Nombre>XXXXX</VNifV2Sal:Nombre><VNifV2Sal:Resultado>IDENTIFICADO</VNifV2Sal:Resultado></VNifV2Sal:Contribuyente></VNifV2Sal:VNifV2Sal></env:Body></env:Envelope>

Última edición por iMia fecha: 10-03-2023 a las 17:06:56. Razón: Poner etiquetas [delphi] [/delphi] al código.
Responder Con Cita