Hi,
I'm using webservices to communicate with Navision. I used the code present in html page :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnav/html/nav_accbizlayerws.asp.
I created two messagequeue: one to send message to navision and the other to receive the response of the message sent.
The code of the webmethod is:
string request = "GetCustomer()";
toNavision.Send (request, "Navision MSMQ-BA");
fromNavision.Formatter = new
System.Messaging.XmlMessageFormatter (new Type[] {typeof (NavDS)});
msg = fromNavision.Receive (new System.TimeSpan (0,0,0,20));
NavDS nds = new NavDS ();
nds.ReadXml (msg.BodyStream, System.Data.XmlReadMode.Auto);
return nds;
I look on the folder of my messageQueue(N.B: my messageQueue are private). The MessageQueue Which sends message to navision contains the message sent but there is no message in the messageQueue which receives response from navision . So no message is returned to this Queue from Navision
Also I look on the application log and the system log and there is no message concerning Navision, so i can't know what is the error.
Please somebody can help me to know the problem?
Thank you for your help.
Comments
Is Navision Application Server working well?
It seem's that it can't consume the message you sent from the webservice
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
I'm using NAS and it works well because when i start the start up parameter the application log indicates that it starts well.
is there any debuuger in NAS?
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
I ran the debug "step into(F8)" of navision and the execution stopped suddenly with the error "break error" at the instruction CREATE(MQBUS).
I remind that my code in navision is:
CLEAR(CC2) ;
CREATE(MQBUS);
CREATE(CC2);
CREATE (XMLDom);
CC2.AddBusAdapter(MQBUS,1);
MQBUS.OpenReceiveQueue('.\private$\MQToNavision',0,0);
the error is in the second instruction (Create MQBUS) where MQBUS is an automation variable of subtype Navision MS-Message Queue Bus Adapter.MSMQBusAdapter
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
I created CC2 as an an automation variable with events (The subtype of CC2 is Navision MS-Message Queue Bus Adapter.MSMQBusAdapter). but when i run the codeunit it doesn't execute instructions placed on the event section of CC2:
this is my code:
Onrun()
CREATE(MQBUS);
CREATE (XMLDom);
CREATE(CC2);
CC2.AddBusAdapter(MQBUS,1);
MQBUS.OpenReceiveQueue('.\private$\MQToNavision',0,0);
//The event of CC2
CC2::MessageReceived(VAR InMessage : Automation "''.IDISPATCH")
// load the message into an XML document and find the string node
InMsg := InMessage;
InS := InMsg.GetStream();
XMLDom.load (InS);
XMLNode := XMLDom.selectSingleNode ('string');
// parse the request and according to the Request variable, redirect to
// the appropriate function
ParseRequest (XMLNode.text);
CASE Request OF
'GetCustomer':
Bizlayer.GetInstance(XMLDom);
'InsertServOrder':
InsertServOrder (Parameters[1],Parameters[2],Parameters[3] );
'InsertLineServOrder':
InsertLineServOrder (Parameters[1],Parameters[2],Parameters[3] );
ELSE
END;
// open the response queue and create a new message
MQBUS.OpenWriteQueue('DB-SERVER\private$\MQFromNavision',0,0);
OutMsg := CC2.CreateoutMessage('Message [url=queue://DB-SERVER]queue://DB-SERVER[/url]\Private$\MQFromNavision');
XMLDom.save (OutMsg.GetStream());
// fill the message and send it
OutMsg.Send(0);
I don't know why it doesn't execute CC2::MessageReceived(VAR InMessage : Automation "''.IDISPATCH") or when i can see messages inside the MessageQueue(messagequeue which sends message to navision).
RIS Plus, LLC
Now the messages are well written in the destination queues but i can't get them in my webmethod with the method Receive of MessageQueue.
So when the webservice execute the intruction "fromNavision.receive" (Where fromnavision is my destination Queue), the operations takes times without results and after the system tells me that time is expired.
Please, someone could help me to find the problem?
What about the fromNavision variable. Is it set up correctly to receive in the same queue as Navision is try to write to?
“This posting is provided "AS IS" with no warranties, and confers no rights.”