|
Home > Archive > BizTalk Server General > December 2005 > Reading messages from MSMQ
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Reading messages from MSMQ
|
|
|
| Hi,
I'm having trouble with the messages I'm reading from a queue using
the MSMQ adapter. Biztalk picks the message up but then goes no
further, giving me the error "None of the components at Disassemble
stage can recognize the data." If I view the message I can see that
it looks like the expected incoming message except there's a space
between every character.
Some reading on the net suggests that this is caused by a difference
in the encoding of the message on the queue and the encoding biztalk
expects but I'm not sure how to fix it. I can't see any way to
change it on the default xml receive pipeline, or the MSMQ for that
matter.
Thanks in advance.
| |
|
| Does anybody have any experience with this? I would appreciate even
just being pointed towards some relevant documentation.
| |
|
| Bump.
One last try. Am I even on the right track with this encoding thing?
| |
| Tomas Restrepo \(MVP\) 2005-12-23, 2:49 am |
| MCE,
>
> I'm having trouble with the messages I'm reading from a queue using
> the MSMQ adapter. Biztalk picks the message up but then goes no
> further, giving me the error "None of the components at Disassemble
> stage can recognize the data." If I view the message I can see that
> it looks like the expected incoming message except there's a space
> between every character.
>
> Some reading on the net suggests that this is caused by a difference
> in the encoding of the message on the queue and the encoding biztalk
> expects but I'm not sure how to fix it. I can't see any way to
> change it on the default xml receive pipeline, or the MSMQ for that
> matter.
How are you sending (or rather, the sending application) the message into
the queue?
If it's using System.Messaging, which message formatter is it using (if
any)? the XmlMessageFormatter, the BinaryFormatter, or the
ActiveXMessageFormatter?
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
| |
| HablaElBiz 2005-12-23, 5:54 pm |
| Sounds like your submitter is using the ActiveX formatter on your
messages. The result of doing that is that your messages look like
they're UTF-16 encoded, but there's no Byte Order Mark (aka BOM) on the
string. It gets to BizTalk, and BizTalk (or even IE if you try it)
can't read the data because it doesn't know how to interpret it.
If you send it UTF-8 (doesn't have the every-other space look) you
don't need the BOM for it to be able to read the data OK.
My shop ran into this, and we wound up creating a pipeline component to
add the BOM to the message. In our case it was much easier to do that
than to change the sending applications.
UTF-what? Read this:
http://www.w3.org/TR/2004/REC-xml-2...4/#charencoding
If you do change the sending apps, you can use code like this:
(a coworker of mine found this in MS example code)
//
****************************************
****************************************
**
// 'Send Direct' - in this case .Net Framework will send your content
as it is.
// This a recommended way of sending MSMQ message to BizTalk.
//
****************************************
****************************************
**
private void button1_Click_1(object sender, System.EventArgs e)
{
try
{
MessageQueue mq = new MessageQueue("Queue");
System.Messaging.Message msg = new System.Messaging.Message();
StreamWriter wr = new
StreamWriter(msg.BodyStream,System.Text.Encoding.Unicode);
wr.Write(szXML);
wr.Flush();
mq.Send(msg,MessageQueueTransactionType.Single);
textError.Text = "Success.";
}
catch (Exception ex)
{
textError.Text = ex.ToString();
}
}
Good luck!
|
|
|
|
|