Hi ,
i came across a very strange problem . i have generated a system where from MSMQ the NAS is going to respond to upcoming of any new message(an xml file) and every time a new message comes , it is going to increase the ENTRYNO field(type int ) of a table called 'Cheque Messages'. But in inspite of all the steps that are to be taken for a successful operation of NAS, NAS is failing to detect any new message in MSMQ.
I have used in the trigger 99 (NASHandler) of Codeunit 1 , a variable called NavCom which points to a codeunit to carry out the above step (i.e. increamenting the ENTRYNo). I lalso have ticked up the SingleInstance poroperty to yes for the codeunits.
Also the NAS is working properly as is being showed by the Event-Log.
Can anyone suggest , what is wrong with the system ?
Subhasish Chakraborty,
Systems Analyst,
MBS Dynamics.
0
Answers
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Tell me one thing, do I need to install the Navision Business notification Server as well , so as to make the NAS know that there is a new message in the MSMQ ?
I have used the proper parameter , and also the Application Log is showing that the NAS is operating correctly.
Systems Analyst,
MBS Dynamics.
Automation 'Navision Timer 1.0'.Timer, 'CP Timer'.cTimer, 'CP Handler'.CQueueHandler or similar with WithEvents=Yes
if WithEvents=Off(default) the codeunit does only one round of instructions (see codeunit 5065,6208,6221)
Dan Lindström
NCSD Navision 2.00 since 1999 (Navision Certified Solution Developer)
MBSP Developer for Microsoft Dynamics NAV 2009
BN is not needed for that functionality.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
But I am using a codeunit called 'Message Recieve' , where I used a communication Component , and have ticked the with events property to yes.
But still the NAS is failing to check out for a new message in the MSMQ and the Event Log is showing that NAS is fucntioning properly !
Systems Analyst,
MBS Dynamics.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
OnRun()
CLEAR(CC2);
CLEAR(MQBus);
CREATE(MQBus);
CREATE(CC2);
CLEAR(XMLDom);
CREATE (XMLDom);
CC2.AddBusAdapter(MQBus,1);
MQBus.OpenReceiveQueue('.\Private$\toNavision',0,0);
DecodeXml(XmlDom : Automation "'Microsoft XML, v3.0'.DOMDocument")
IF ISCLEAR(CurrNode) THEN
CREATE(CurrNode);
IF ISCLEAR(ReturnedNode) THEN
CREATE(ReturnedNode);
CurrNode := XmlDom.documentElement;
WITH XMLDomMgt DO BEGIN
IF FindNode(CurrNode,'Action',ReturnedNode) THEN
BEGIN
IF STRLEN(ReturnedNode.text) > 0 THEN
vStrAxn:=(ReturnedNode.text);
END;
END;
WITH XMLDomMgt DO BEGIN
IF FindNode(CurrNode,'Entity',ReturnedNode) THEN
BEGIN
IF STRLEN(ReturnedNode.text) > 0 THEN
vStrEntity:=(ReturnedNode.text);
END;
END;
IF (vStrAxn='Create')AND(vStrEntity='Item') THEN
BizLayerItem.ParseXmlDocument(XmlDom);
CC2::MessageReceived(VAR InMessage : Automation "''.IDISPATCH")
InMsg := InMessage;
InS := InMsg.GetStream();
XMLDom.load (InS);
DecodeXml(XMLDom);
here i have marked , the single-instance property to yes.
and CC2's with event is also set to yes.
Systems Analyst,
MBS Dynamics.
1: Your message queue must be a private queue.
2: Your message queue must be non-transactional. The comcom and the MQBA do not know how to deal with transactional message queues. Messages will just disappear or your code will behave in an unpredictable manner.
3: MSMQ Active Directory support must not be installed, this has screwed up MSMQ monitors in my experience.
4: The messages must be in single byte encoding. The second hex number in double byte characters is the same as the EOS marker in single byte characters, and that screws up the MSBA. If you don't have a choice, you will have to program MSMQ communication directly using its own object model
RIS Plus, LLC
.
Can you please explain this in more details? It was not very clear to me.
Systems Analyst,
MBS Dynamics.
and may be you can try to open the message queue with lowercase name ".\private$\tonavision". Be sure, that NAS has enough permissions on the queue to read and delete messages from it.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Also, the Windows user that is set up as the user for NAS must be a valid user in NAV.
RIS Plus, LLC
Systems Analyst,
MBS Dynamics.
Systems Analyst,
MBS Dynamics.
RIS Plus, LLC