MSMQ problem (The stream returned a read error)

SteveOSteveO Member Posts: 164
edited 2006-01-24 in Navision Attain
I am using the Navision Communication Component and the MSMQ bus adapter to read messages off a message queue.

The problem I am experiencing is that the following code:


InMsg := InMessage;

StreamIn := InMsg.GetStream;

CREATE(XMLDOM);

XMLDOM.load(StreamIn); // THIS LINE RIGHT HERE :evil:

causes a message to pop up that states "The stream has returned a read error". The necessary processing still continues and there are no other problems, it's just that this message is very annoying and also the app we are trying to develop is meant to be automatic. ie. The user shouldn't have to keep on clicking on the OK button every time this message pops up.

My OS is Windows 2000 Professional.
Navision Version : 3.01 3.10 3.6 3.7 (Happens in all of them)
XMLDOM is automation server: 'Microsoft XML, v3.0'.DOMDocument30
And I have installed MSMQ components (I suspect the error might be because I am running in WORKGROUP mode???)

This program works fine if I don't read the xml from the stream, ie it is a physical file on my harddrive. (This is not the answer though as we need to read from the stream) Anybody know why this message pops up and how to get rid of it??

Thanks
SteveO
This isn't a signature, I type this at the bottom of every message

Comments

  • Stefan_HillmannStefan_Hillmann Member Posts: 9
    Hi SteveO,

    try the following code snippet ...

    InMsg := InMessage;

    IF InDOM.load(InMsg.GetStream) THEN
    ...your processing here ...
    else
    ERROR(InDOM.parseError.reason);


    On the other hand try to use MSXML4 SP2, while this release has several bugfixes inside...


    Good luck...

    Stefan
  • SteveOSteveO Member Posts: 164
    Thanks for your reply.

    I managed to get the problem sorted out.

    I am now using the component that you suggested.

    Many Thanks!!
    This isn't a signature, I type this at the bottom of every message
  • Captain_DX4Captain_DX4 Member Posts: 230
    I am getting the same "The stream has returned a read error" message on my installation.

    I've tried installing the NAS on a Windows 2000 box, and a Windows 2003 box. Same results on both. My setup in code does not include a XMLDOM object, so some of the pointers listed further up in this thread seem not to apply. After quite a bit of searching on the Knowledge Base at MBS Partner site and the forums here, I'm still feeling quite stumped.

    Any insights would be appreciated. Please let me know if more details for my particular setup are required.
    Kristopher Webb
    Microsoft Dynamics NAV Developer
Sign In or Register to comment.