1

I am trying to save and load an xml file from my hard disk drive by calling the above code

  TS.SaveToFile(Def_Response_XmlFile, TEncoding.UTF8);
  XMLResponseDoc := LoadResponseDoc(Def_Response_XmlFile);

But when I called the following function

    function LoadResponseDoc(const FileName: string): IXMLResponseDoc;
begin
  ShowMessage('' +FileName);
  ShowMessage('' +TXMLResponseDoc);
  ShowMessage('' +TargetNamespace);
  Result := LoadXMLDocument(FileName).GetDocBinding('ResponseDoc', TXMLResponseDoc, TargetNamespace) as IXMLResponseDoc;
  ShowMessage('arrive here');
end;

I took as response the mentioned error.Any ideas what am I doing wrong?

yannis_kal
  • 55
  • 6
  • What is TS declared as? What does the saved XML actually look like? Perhaps the load is failing, or the XML doesn't match what `TXMLResponseDoc` is expecting. – Remy Lebeau Feb 18 '21 at 17:35
  • Thank you very much for your help Remy! My bug was that I didn't initialized XMLResponseDoc with NewRequestedDoc command. – yannis_kal Feb 19 '21 at 09:15

0 Answers0