MSMQ Problem

All, I’m trying to use the message queue to call Navision codeunits from outside Navision. I’ve been successful with this using Named Pipes, and I am quite comfortable with the code I’m using (i.e. single instance codeunit with standard MSMQ code as posted in communication component development guide, etc.), but my MessageReceived event simply isn’t firing. I am generating messages out of VS.Net 2003, and I have confirmed that these messages are going to the appropriate queue. Navision just isn’t being notified of their arrival. One note is that I am not using the Navision communication components inside VS.Net - I’m using VS.Net MessageQueue components instead because I figured, as long as the message gets to the queue, what does it matter? Any ideas? waynewil

Wayne, I remember a while back doing some similar work to this (ie using the Microsoft MSMQ automation objects to control the queue and not the Navision ones). The problem I found was that the navision COM objects will only recognise messages with a very specific name property. Unfortunately I cant remember what the name was but you could possibly work it out by pushing a message to the queue with the Navision COM objects and checking its propertis in the MMC interface. Then use a similar name property when constructing your messages in the VS.NET code. I hope this helps. Regards, Chris.

The label in question is ‘Navision MSMQ-BA’. Regards, Edward.

Thank you Edward. You fixed my problem. Navision will now get my data out of the queue. If I can only get NAS to CONTINUE to watch the queue and pull out messages put there I will be well on my way to designing my solution. I have to manually start my queue reader codeunit. Then because it is SingleInstance Yes it continues to watch the queue. The NASHandler function (ID 99) in the ApplicationManagement codeunit calls this codeunit but it for some reason does not begin watching the queue as when I manually start it.

James, Are the ComCom and MSMQ busadaptor varaibles in your single instance codeunit decalared locally or globally? I seem to remember there was a dependency for them to be set globally to work properly in single instance codenits. This might be your problem. Chris

Chris, ComCom and MSMQ busadaptor are global. It turns out that it was my problem. I set the NAS to run on company A. But I was logging into the database server into company B. With Windows Login automatically signing on, I was not looking at what company it was signing into. :slight_smile: So it does work now that I’m in the right company. To Whomever May Want It: I have the VB app. that will send data into message que, the source code (commented) and the EXE, and the Navision Objects in FOB and TXT. If anyone wants them for their own testing just email me. You just follow the instructions in the tutorial document (NASAndComcom.doc which I have as well if needed). The Navision Objects I have are derivative of the ones you are instructed to create in the tutorial. I would have loved to have a head start like this so that is why I’m offering it here. Good Luck!

I’m very interested indeed. Couldn’t you upload it to Lots of people who didn’t read this topic could download.

Erik, I wrote something up explaining it and submitted it to MIBUSO. If it helps anyone else get started then I feel I’ve contributed a little something.

Thx, could you provide a link when it is published?

No problem Erik. I will post the link here when it has been approved. The first ZIP I sent somehow got there empty so I had to resubmit it today. So it should be within the next couple days.

They have posted the ZIP on MIBUSO. Here’s the link: