InStream Problems

jfelgueiras
jfelgueiras Member Posts: 7
Hi,
Any one know how I can use a inStream twice?
I explain:
I received a InStream (from a MSQueue). I need to generate a XMLDocument (using Xmldoc.load(inStream) to verify some XML tags, but I need to keep the inStream for using in a XMLPort (using XMLPORT.IMPORT(50000,inStream);

The problem is that when I load the XMLDocument I can't use the inStream anymore. the trouble is that I can't use the file System for Security reasons.

Can anyone help me?
thank you

Comments

  • ara3n
    ara3n Member Posts: 9,258
    Create two variables?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jfelgueiras
    jfelgueiras Member Posts: 7
    ara3n wrote:
    Create two variables?

    I doesn't work. If I assign the instream (before i use it) to another variable. wen I use the first instream variable the other one becomes empty.
  • ara3n
    ara3n Member Posts: 9,258
    save the xml to a file and create another stream from the file.
    Xmldoc.save(c:\temp\tempxml.xml);
    myfile.open(c:\temp\tempxml.xml);
    myfile.createinstream(istream2);
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • jfelgueiras
    jfelgueiras Member Posts: 7
    Yes, thats the way I resolved my problem, but I created a temporaryfile instead (file.createtempfile).
    But I would know if there is no other way. Because, if I can, I prefer not to use the file system.

    Do you know other way?
    Thank you