NAS not answering the handler function “MessageReceived”

himadripaul
Member Posts: 21
I am trying to read data from MSMQ by using Navision Communication component and MSMQ Bus adapters. The code has been written in Codeunit which is run by NAS. The NAS is running fine with the starting parameter.
The problem is: when a new message is sent to the request queue, the Application Server does not process it. The OnRun() trigger of the codeunit gets fired ( I have put one message and it is getting processed) but the handler function “MessageReceived” is not fired. I have checked my message in the Event viewer. I put a "MESSAGE" statement at the beginning of the function but I don't see anything on the message log.
Please help me out.
The problem is: when a new message is sent to the request queue, the Application Server does not process it. The OnRun() trigger of the codeunit gets fired ( I have put one message and it is getting processed) but the handler function “MessageReceived” is not fired. I have checked my message in the Event viewer. I put a "MESSAGE" statement at the beginning of the function but I don't see anything on the message log.
Please help me out.
0
Comments
-
Do you have enabled the property "WithEvent" on your "Navision Communication component" variable?
RegardsDo you make it right, it works too!0 -
1) MSMQ NAV component is not working on x64bit OS.
2) The message must have specific label to be processed by the component ("Navision MSMQ-BA")0 -
The “WithEvent” property of "Navision Communication component" is enabled. MSMQ is working on 32 bit OS. Still I am getting the same problem.0
-
-
The Lable of the message is passing form a .NET application into MSMQ. But still I am facing the same problem.0
-
Yes, but is it exactly "Navision MSMQ-BA"??? If not, NAV MSMQ component will not process this message...0
-
Hi,
Thanks for the info. I have made label as "Navision MSMQ-BA" but still my problem remain unsloved.
In the Event Viewer--> Application--> Property I am seeing that ComCon is created but that particular function (MessageReceived) is not getting fired.
Please help me out.0 -
Is your request queue transactional? As far as I remember the MSMQ component in NAV only accepts messages from non-transactional queues.//Bogdan0
-
My "toNavision" queue is not transactional.0
-
Hi,
Does the user you are using to run the NAS have access to the Queue, check the security settings on your queues. For testing purposes, give everyone full access.
Then restrict access to the NAS-user after you were able to receive the message.
Also is your queue a private or public queue? If it is public, create a queue as a private queue and use that for testing.
Hope this helps,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Hi Willy,
Thanks for your response. I have given full access to everyone in the security setting of my Private Queue but the problem remain unsolved.
Please let me know what all I need to check further. ](*,)0 -
Hi,
I am getting a new Warning when looking into the Computer Manamement--> Event Viewer-->Application--> One warning is coming as follows:
"The call to member OpenReplyQueue failed. MSMQQueueInfo returned the following message:
The queue does not exist or you do not have sufficient permissions to perform the operation. "
I have checked the Private Message queue and the the same Queue name is there in codeunit. I have given Full permission also in the queue property for all the users.
Any help please!!!0 -
Perhaps you could paste the path to your queue.
If the Queue is located on another machine, you might have to give permissions to "anonymous logon" for the NAS to be able to open the queue. "anonymous logon" is, based on my experience, not included in "everyone".0 -
Hi,
The queue is located in the same machine where NAS is installed.0 -
I guess you have two queues - incoming and outcoming. Did you checked the permissions on both? Sometime it is better to delete the queues and create them manually again, with correct permissions. It seems that the outcomming queue is not created...0
-
Hi,
Could you please paste your code to this forum. This might help us a lot.
I think the problem lies in the way you are defining your queue name in the C/AL code.
Please paste the name of your queue in code and the section of code where you create and use your automation.
Thank you,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Hi,
The permission problem of Message Queue gets solved. But when I am running Navision application , in Computer Management-->Even Viewer--> Application, I am seeing the descriprion of each of the information like "Open Receive Queue", "Create MSMQ", "Create ComCom" (all the messages I have introduced in my codeunit for better clarity) But the last informaion is coming as follows:
"The description for Event ID ( 20010 ) in Source ( SM8LAPCA-001-SQL ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event:
Navision Application Server version 4.0 SP3 (Build 23305)
Copyright (c) 1987-2006 Microsoft Corporation"
And finally I am not getting any value in my table (created in Navision) from the queue. The insert statement is written in the codeunit under (ComCom::MessageReceived(VAR InMessage : Automation "''.IDISPATCH") function.
Please help me out.
.0 -
My Code is as follows:
OnRun()
MESSAGE('Enter codunit'); // This info is showing in Event Viewer (Computer management)
IF ISCLEAR(ComCom) THEN BEGIN
CREATE(ComCom);
MESSAGE('Created ComCom');
END;
IF ISCLEAR(MSMQ_BA) THEN BEGIN
CREATE(MSMQ_BA);
MESSAGE('Created MSMQ'); // This info is showing in Event Viewer (Computer management)
END;
Queue1Name := '.\private$\sendqueue';
Queue2Name := '.\private$\fromnavision';
ComCom.AddBusAdapter(MSMQ_BA,1);
MSMQ_BA.OpenReceiveQueue(Queue1Name,0,0);
MESSAGE('Open receive Queue'); // This info is showing in Event Viewer (Computer management)
MSMQ_BA.OpenReplyQueue(Queue2Name,0,0);
ComCom::MessageReceived(VAR InMessage : Automation "''.IDISPATCH") // This function is
//not working
MESSAGE('New MSMQ message received!');
InMsg := InMessage;
InStreamQueue := InMsg.GetStream();
REPEAT
InStreamQueue.READTEXT(XMLChar);
XMLText := XMLText + XMLChar;
UNTIL InStreamQueue.EOS;
CREATE(XMLDoc);
XMLDoc.loadXML(XMLText);
MESSAGE('hi');
IF FindNode(XMLDoc,'string',XMLNode) THEN
MsgCont := XMLNode.text;
strFld1 := SELECTSTR(1,MsgCont);
strFld2 := SELECTSTR(2,MsgCont);
strFld3 := SELECTSTR(3,MsgCont);
strFld3 := SELECTSTR(4,MsgCont);
recWebtable.INIT;
recWebtable.Code := strFld1;
recWebtable.Name := strFld2;
recWebtable.Address := strFld3;
recWebtable."Contact No." := strFld4;
recWebtable.INSERT;
InMsg.CommitMessage;
CLEAR(InMsg);
Please help me out0 -
Is your codeunit single instance? (Open codeunit in design mode, Shift + F4 or View - Properties, SingleInstance)
It has to be single instance so that it't variables remain in computer memory in order to "listen" for the incoming messages...//Bogdan0 -
Yes. My codeunit is Singel Instance.0
-
Can I get anybody's msm id (@hotmail) so that I can add and chat online (if I am not disturbing anybody) for getting valuable inputs/ helps0
-
Can you see some messages waiting in the queue when looking into the queue through computer management?0
-
Messages is waiting in the queue. It has not been processed.0
-
I've the same problem with MessageReceived function. No message is received, messages still in queue.
I checked all parameters and authorization. Everything seem ok but it doesn't work.
Did you solve your problem ?
Could you help me ?0 -
jlg wrote:I've the same problem with MessageReceived function. No message is received, messages still in queue.
I checked all parameters and authorization. Everything seem ok but it doesn't work.
Did you solve your problem ?
Could you help me ?
Did you checked that:
you are using 32bit OS?
message has correct label?
message is in correct format (UTF-8 and not UTF-16)?0 -
Hi,
could you try it with the direct queue name.
You have:
Queue1Name := '.\private$\sendqueue';
Queue2Name := '.\private$\fromnavision';
try it with:
Queue1Name := 'Direct=OS:\\<computername>\private$\sendqueue';
Queue2Name := 'Direct=OS:\\<computername>\private$\fromnavision';
Where <computername> is the name of the computer where the Queue resides.
I had it once that the direct option worked and the other did not.
Hope this helps,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Kine,
I checked and parameters are ok.
KyDutchie,
I tried with format 'Direct=OS:\\<computername>\private$\sendqueue' and NAS return this error :
The call to member OpenReceiveQueue failed. MSMQQueueInfo returned the following message:
The format name specified is invalid.
I tried with format 'Direct=TCP:\\<IP address>\private$\sendqueue' and NAS return this error :
The call to member OpenReceiveQueue failed. MSMQQueueInfo returned the following message:
The remote computer is not available.0 -
It seems that my codeunit don't receive event when a new message arrives in the queue. So,
MessageReceived function don't start.
Could you help me ?0 -
Hi Kine,
How do I know that my message is in correct format (UTF-8 and not UTF-16) ?0 -
When you look at the message or you somehow export it, there must be only one byte per character, not two (second is 0x0 char...).0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions