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.
0
Comments
Regards
2) The message must have specific label to be processed by the component ("Navision MSMQ-BA")
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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.
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,
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. ](*,)
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!!!
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".
The queue is located in the same machine where NAS is installed.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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,
Willy
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.
.
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 out
It has to be single instance so that it't variables remain in computer memory in order to "listen" for the incoming messages...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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)?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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,
Willy
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.
MessageReceived function don't start.
Could you help me ?
How do I know that my message is in correct format (UTF-8 and not UTF-16) ?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.