I need to communicate with a legacy application from my C# app via the Windows Message Queue.
The legacy application expects plain string messages in a particular private queue, but I can't seem to stop the System.Messaging.MessageQueue from wrapping my message in XML!
The code I'm testing is very simple:
MessageQueue myQueue = new MessageQueue(@".\Private$\tolegacy");
Message msg = new Message("My Test String");
myQueue.Send(msg);
The trouble is that the message is being XML serialized and appears in the queue as:
<?xml version="1.0"?><string>My Test String</string>
I can't modify the behaviour of the legacy application, so I need to stop the System.Messaging.MessageQueue from formatting my message as XML.
Can anyone help?