Sending/Receiving XML document to/from MSMQ

G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top