Getting XML documents from MSMQ

  • Thread starter =?iso-8859-1?Q?Stefan_N=E4sman?=
  • Start date
?

=?iso-8859-1?Q?Stefan_N=E4sman?=

Hi

When reading XML documents from a MSMQ Queue I get some
serialization exception and I don't know how to solve it.

Exception message:
"Cannot deserialize the message passed as an argument.
Cannot recognize the serialization format."

try
{

System.Messaging.MessageQueue mq =
(System.Messaging.MessageQueue)source;
mq.Formatter = new XmlMessageFormatter(new string
[] {"System.String"});
System.Messaging.Message m = mq.EndReceive
(asyncResult.AsyncResult);
mq.BeginReceive();

theCallBack(m.Body.ToString(),mq.QueueName);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}

Regards

Stefan Näsman
 

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