XMLPort.Import and save data into file

SMH_PTGSMH_PTG Member Posts: 4
Hi all,

I have one codeunit which have all my webservices methods.

On of them, named ImportSalesOrder, should receive data but instead of create a new sales order, should save the XML message into file.

My code is something like this but the file created is empty.

CLEAR(OutStream);

IF ISCLEAR(XMLDocument) THEN
CREATE(XMLDocument);

XML.SETDESTINATION(OutStream);
XML.IMPORT;
XMLDocument.load(OutStream);
XMLDocument.save(FileName);
EXIT(TRUE);

Can anyone have some ideas how can i solve this? ](*,)

Thanks in advance.
Best Regards
SMH_PTG

Comments

  • SMH_PTGSMH_PTG Member Posts: 4
    No ideas? :cry:
    Best Regards
    SMH_PTG
  • DakkonDakkon Member Posts: 192
    What are the arguments being passed to your procedure that does the work?
    Thad Ryker
    I traded my sanity for a railgun :mrgreen:
  • SMH_PTGSMH_PTG Member Posts: 4
    Hi Dakkon,

    Problem Solved. Import for a temporary table and the export from temp to file.

    XMLvar.IMPORT;

    Filename := 'd:\test.xml';
    FileToCreate.CREATE(FileName);
    FileToCreate.CREATEOUTSTREAM(Outstream);
    XMLvar.SETDESTINATION(Outstream);
    XMLvar.EXPORT;
    FileToCreate.CLOSE;

    Thanks,
    Best Regards
    SMH_PTG
  • DakkonDakkon Member Posts: 192
    Good to hear, thanks for letting us know and don't forget to mark the post [Solved] :D
    Thad Ryker
    I traded my sanity for a railgun :mrgreen:
Sign In or Register to comment.