|
Home > Archive > BizTalk Server Orchestration > June 2006 > serializing XML message in MSMQ ActiveX format
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 |
serializing XML message in MSMQ ActiveX format
|
|
| fullflavedave 2006-06-06, 7:19 pm |
| In BizTalk 2006, I am sending an xml message to an existing MSMQ hub. The
messages arrive at the hub fine, but I get a "Cannot deserialize the message
passed as an argument. Cannot recognize the serialization format" error. I
think the error is because the existing message queue is set up to receive
messages serialized using the ActiveX format (using ActiveXMessageFormatter.
We use the message hub with COM objects).
Is there any way to serialize my XML messages in BizTalk 2006 into the
ActiveX format (or utilize ActiveXMessageFormatter())? If necessary, how can
I do this in a send pipeline?
Many Thanks,
Dave
| |
| Tomas Restrepo \(MVP\) 2006-06-07, 1:19 am |
| Dave,
> In BizTalk 2006, I am sending an xml message to an existing MSMQ hub. The
> messages arrive at the hub fine, but I get a "Cannot deserialize the
> message
> passed as an argument. Cannot recognize the serialization format" error.
> I
> think the error is because the existing message queue is set up to receive
> messages serialized using the ActiveX format (using
> ActiveXMessageFormatter.
> We use the message hub with COM objects).
>
> Is there any way to serialize my XML messages in BizTalk 2006 into the
> ActiveX format (or utilize ActiveXMessageFormatter())? If necessary, how
> can
> I do this in a send pipeline?
It is possible, depending on what the MSMQ receiver application reads
messages as. What are they receiving them as? Strings? If so, you'll want to
make sure that the messages are being generated by the pipeline in UTF-16
with no BOM, and then configure the send port correctly to generate the Body
Type property. See
| |
| Tomas Restrepo \(MVP\) 2006-06-07, 1:19 am |
|
> In BizTalk 2006, I am sending an xml message to an existing MSMQ hub. The
> messages arrive at the hub fine, but I get a "Cannot deserialize the
> message
> passed as an argument. Cannot recognize the serialization format" error.
> I
> think the error is because the existing message queue is set up to receive
> messages serialized using the ActiveX format (using
> ActiveXMessageFormatter.
> We use the message hub with COM objects).
>
> Is there any way to serialize my XML messages in BizTalk 2006 into the
> ActiveX format (or utilize ActiveXMessageFormatter())? If necessary, how
> can
> I do this in a send pipeline?
It is possible, depending on what the MSMQ receiver application reads
messages as. What are they receiving them as? Strings? If so, you'll want
to
make sure that the messages are being generated by the pipeline in UTF-16
with no BOM, and then configure the send port correctly to generate the
Body
Type property. See
http://www.winterdom.com/weblog/200...00
6.aspx
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
| |
| fullflavedave 2006-06-07, 7:18 pm |
| That got me past it -- thanks a bunch! I needed to use VT_LPSTR (30) for the
hub to recognize the message. In configuring the XML Assembler in my
pipeline, I couldn't find UTF-16 as an option (only Big-Endian-UTF16 and
Little-Endian-UTF16), but it does seem to be recognizing the messages OK.
Now I get a different error from the MSMQ hub -- a completely unhelpful
"System.web.Services.Protocols.SoapException: Server was unable to process."
-- even though I see that the xml in the message looks exactly like the xml
in messages that process fine. I'll check my data and SOAP stuff, but I'm
definitely grateful that you got me this far. I wasn't excited about writing
a custom assembler.
Your blog post was great!
Thanks again,
Dave
"Tomas Restrepo (MVP)" wrote:
>
>
> It is possible, depending on what the MSMQ receiver application reads
> messages as. What are they receiving them as? Strings? If so, you'll want
> to
> make sure that the messages are being generated by the pipeline in UTF-16
> with no BOM, and then configure the send port correctly to generate the
> Body
> Type property. See
> http://www.winterdom.com/weblog/200...00
6.aspx
>
>
> --
> Tomas Restrepo
> tomasr@mvps.org
> http://www.winterdom.com/
>
>
>
| |
|
| I am trying to get message from MSMQ using MSMQ adapter in biztalk
2006. I keep getting errors like There was a failure executing the
receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive,
Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive
Port: "ReceivePort1" URI:
"FORMATNAME:DIRECT=OS:IT-WEB001\PRIVATE$\TEST" Reason: No Disassemble
stage components can recognize the data.
I use three formatter ActiveXMessageFormater, XMLMessageFormater and
sending message as a stream. None of them can success.
How can I send a message to the MSMQ so that the MSMQ adapter can
recognize the message?
Thank you so much, I have spending two days on this matter with no
luck.
Jane
fullflavedave wrote:
> In BizTalk 2006, I am sending an xml message to an existing MSMQ hub. The
> messages arrive at the hub fine, but I get a "Cannot deserialize the message
> passed as an argument. Cannot recognize the serialization format" error. I
> think the error is because the existing message queue is set up to receive
> messages serialized using the ActiveX format (using ActiveXMessageFormatter.
> We use the message hub with COM objects).
>
> Is there any way to serialize my XML messages in BizTalk 2006 into the
> ActiveX format (or utilize ActiveXMessageFormatter())? If necessary, how can
> I do this in a send pipeline?
>
> Many Thanks,
> Dave
| |
| Tomas Restrepo \(MVP\) 2006-06-10, 1:19 am |
| Jane,
>I am trying to get message from MSMQ using MSMQ adapter in biztalk
> 2006. I keep getting errors like There was a failure executing the
> receive pipeline: "Microsoft.BizTalk.DefaultPipelines.XMLReceive,
> Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
> PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive
> Port: "ReceivePort1" URI:
> "FORMATNAME:DIRECT=OS:IT-WEB001\PRIVATE$\TEST" Reason: No Disassemble
> stage components can recognize the data.
>
> I use three formatter ActiveXMessageFormater, XMLMessageFormater and
> sending message as a stream. None of them can success.
If you're sending the message as a string using an ActiveXMessageFormatter,
then be aware that it will be received as an Unicode (UTF-16 Little Endian)
encoded document with no BOM. because of that, biztalk cannot figure the
content on it's own, so you need to help it a bit, which you can do using my
FixEncoding pipeline component [1]. If you choose to write it as a stream,
it's just a matter of choosing the correct encoding when doing so (UTF-8 is
the one that will likely give you less trouble).
[1] 2006:
http://www.winterdom.com/weblog/200.../>
tSample.aspx
2004:
http://www.winterdom.com/weblog/200...0
04.aspx
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
| |
|
| Thank you so much. I was able to make it work in stream format. I was
concentrating on the ActiveX format since this is how our webService
sending out the message. Your pipline is very valuable. I will try to
make it work. Thanks you again. I am glad there are people like you
helping others.
Jane
Tomas Restrepo (MVP) wrote:
> Jane,
>
> If you're sending the message as a string using an ActiveXMessageFormatter,
> then be aware that it will be received as an Unicode (UTF-16 Little Endian)
> encoded document with no BOM. because of that, biztalk cannot figure the
> content on it's own, so you need to help it a bit, which you can do using my
> FixEncoding pipeline component [1]. If you choose to write it as a stream,
> it's just a matter of choosing the correct encoding when doing so (UTF-8 is
> the one that will likely give you less trouble).
>
> [1] 2006:
> http://www.winterdom.com/weblog/200.../>
tSample.aspx
> 2004:
> http://www.winterdom.com/weblog/200...0
04.aspx
>
>
> --
> Tomas Restrepo
> tomasr@mvps.org
> http://www.winterdom.com/
| |
|
| Hi, Tomas,
I installed your FixMessageEncoding component. And pick utf8 and utf16
(unicode). Both give the same error message as No disassemble stage
component can recognize the data.
Did I miss anything.
Here is the code that I try to send the message:
System.Messaging.MessageQueue mq =
new
System.Messaging.MessageQueue(@".\private$\test");
mq.Formatter = new ActiveXMessageFormatter();
System.Messaging.Message msg = new
System.Messaging.Message();
string str1;
str1="<ns0:LOAN_COMMENTS
xmlns:ns0=\"http://Litton.Datatransfer.Bankruptcy.Schema.LOAN_COMMENT\">";
str1 = str1 +
"<ns0:BATCH_SEQUENCE_NUMBER>BATCH_SEQUENCE_NUMBE</ns0:BATCH_SEQUENCE_NUMBER>";
str1 = str1 + "<ns0:LOAN_COMMENT>";
str1 = str1 + "<ns0:LOAN_NUM>100</ns0:LOAN_NUM>";
str1 = str1 + "<ns0:SEQUENCE>100</ns0:SEQUENCE>";
str1 = str1 +
"<ns0:COMMENT_TYPE>COMME</ns0:COMMENT_TYPE>";
str1 = str1 +
"<ns0:NOTE>TOOTENOTENOTENOTENOTENOTENOTE</ns0:NOTE>";
str1 = str1 +
"<ns0:NOTE_DATE>1999-05-31T13:20:00.000-05:00</ns0:NOTE_DATE>";
str1 = str1 +
"<ns0:USER_NAME>USER_NAMEU</ns0:USER_NAME>";
str1 = str1 +
"</ns0:LOAN_COMMENT></ns0:LOAN_COMMENTS>";
msg.Formatter = new ActiveXMessageFormatter() ;
msg.Body = str1;
mq.Send(msg);
Tomas Restrepo (MVP) wrote:
> Jane,
>
> If you're sending the message as a string using an ActiveXMessageFormatter,
> then be aware that it will be received as an Unicode (UTF-16 Little Endian)
> encoded document with no BOM. because of that, biztalk cannot figure the
> content on it's own, so you need to help it a bit, which you can do using my
> FixEncoding pipeline component [1]. If you choose to write it as a stream,
> it's just a matter of choosing the correct encoding when doing so (UTF-8 is
> the one that will likely give you less trouble).
>
> [1] 2006:
> http://www.winterdom.com/weblog/200.../>
tSample.aspx
> 2004:
> http://www.winterdom.com/weblog/200...0
04.aspx
>
>
> --
> Tomas Restrepo
> tomasr@mvps.org
> http://www.winterdom.com/
| |
| Tomas Restrepo \(MVP\) 2006-06-22, 7:19 pm |
| Jane,
>
> I installed your FixMessageEncoding component. And pick utf8 and utf16
> (unicode).
I'm assuming you created your own pipeline and put the component in the
Decode stage, right? Make sure you pick the little endian variation of
UTF-16, and it *should* work.
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
| |
|
| Hi, Tomas,
I know what happened. I have a schema collection in my pipline. I end
up add two XML assemblers, one with no schema, one with my schema
collection. And it works! Thank you so much. I love it.
I have another questions. What if I use xmlFormater. I know the message
send in the <String></String> wraper. And I could not get it into
orchestration. We want to use XMLFormatter in the long run if we could
because it is more standardized.
Thanks.
Jane
Tomas Restrepo (MVP) wrote:
> Jane,
>
> I'm assuming you created your own pipeline and put the component in the
> Decode stage, right? Make sure you pick the little endian variation of
> UTF-16, and it *should* work.
>
>
> --
> Tomas Restrepo
> tomasr@mvps.org
> http://www.winterdom.com/
| |
| Tomas Restrepo \(MVP\) 2006-06-23, 1:17 pm |
| Jane,
> I know what happened. I have a schema collection in my pipline. I end
> up add two XML assemblers, one with no schema, one with my schema
> collection. And it works! Thank you so much. I love it.
>
> I have another questions. What if I use xmlFormater. I know the message
> send in the <String></String> wraper. And I could not get it into
> orchestration. We want to use XMLFormatter in the long run if we could
> because it is more standardized.
That depends. From the code you sent before, you were sending an Xml message
as a string. The XmlFormatter will do the right thing (i.e. not put the
<string></string> stuff in) if you send an XmlDocument instead of a string.
That said, if you already have an Xml document, why bother going through the
formatter at all? Just write directly to the BodyStream property of the
message instead (you could even write directly to it using an XmlTextWriter,
which you really should be using if you're generating XML manually instead
of concatenating strings by hand).
--
Tomas Restrepo
tomasr@mvps.org
http://www.winterdom.com/
| |
|
| I see. The code I send you just a dummy code for testing. We do receive
a string, or byteArray from our vendors' web services. We have a
webservice to deserialize it and out put into the MSMQ for Biztalk to
pick up. We can not use Biztalk directly due to our netwrok architect.
We only have one web service outside protected secure network. All
others like biztalk in the internal network.
What do you think is the best way to sending the message to the Q?
I do not quite catch you. How can I send a xmlDocument to the Q instead
of a string? I am pretty much a biginner on MSMQ/BizTalk programming.
But I like what I do. It is different.
Thanks so much.
Tomas Restrepo (MVP) wrote:
> Jane,
>
>
> That depends. From the code you sent before, you were sending an Xml message
> as a string. The XmlFormatter will do the right thing (i.e. not put the
> <string></string> stuff in) if you send an XmlDocument instead of a string.
>
> That said, if you already have an Xml document, why bother going through the
> formatter at all? Just write directly to the BodyStream property of the
> message instead (you could even write directly to it using an XmlTextWriter,
> which you really should be using if you're generating XML manually instead
> of concatenating strings by hand).
>
>
> --
> Tomas Restrepo
> tomasr@mvps.org
> http://www.winterdom.com/
|
|
|
|
|