Home All Groups Group Topic Archive Search About

Sending/Receiving XML document to/from MSMQ

Author
20 Jun 2006 1:41 PM
basulasz
I add an XML file as an MSMQ Message to MSMQ with the code

XmlDocument myXml = new XmlDocument();
            myXml.Load("C:\\Emp.xml");

            MessageQueueTransaction mqTrans = new MessageQueueTransaction();
            MessageQueue mq = new MessageQueue();
            try
            {
                mq.Path = @"BASULAS\mqsms";
                mq.DefaultPropertiesToSend.Recoverable = true;
                mqTrans.Begin();
                mq.Send((object)myXml.InnerXml.ToString(), "msgXml",
MessageQueueTransactionType.Single);
                mqTrans.Commit();
            }
            catch (MessageQueueException ex)
            {
                mqTrans.Abort();
                mq.Close();
                throw ex;
            }

I want to get this message and convert it to an XML file again. But i could
not do that. What should I do?

AddThis Social Bookmark Button