I am trying to set up a web service so that I can communicate with navision via a Cold Fusion web site. I am using message queues. I used to simply send the message on one queue and then use receive to get the response message on another queue. I hit a snag when I tried doing several connections at the same time or the browser timed out. The service would receive the first message on the queue regardless of whether it was the message the service was supposed to get back. I then tried to use ReceiveByID so that I could make sure that the messages were being received by the service that was supposed to get them. I believe Navision will use the same ID for the response message as the message nav received. The problem comes in when I try to figure out the ID of the message I sent to navision. Is there a function that sends the message and returns the ID? Or am I going about this wrong? Here is my code in VB.Net:
Public Function SendMsg(ByVal Message As String) As String
Dim mqFromNavision As Messaging.MessageQueue = New Messaging.MessageQueue("FromNavision")
Dim mqToNavision As Messaging.MessageQueue = New Messaging.MessageQueue("ToNavision")
Dim messageid As String // this will be the id of the sent message
mqToNavision.Send(Message, "Navision MSMQ-BA")
mqFromNavision.Formatter = New Messaging.XmlMessageFormatter(New Type() {GetType(String)})
Dim QueueMessage As Messaging.Message = mqFromNavision.ReceiveById(messageid, New System.TimeSpan(0, 0, 0, 30))
Return QueueMessage.Body
End Function
Comments
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
RIS Plus, LLC