|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Writing XML to MQ |
« View previous topic :: View next topic » |
Author |
Message
|
sajid08 |
Posted: Fri Sep 08, 2006 3:29 am Post subject: Writing XML to MQ |
|
|
Novice
Joined: 08 Sep 2006 Posts: 22 Location: Karachi
|
Hi All!
This is my first post here, hope you people would help me
I've a simple form made in c# that makes a WebSphere MQ object and using its WriteString(), method writes the xml to the queue. That queue is configured in my Biztalk project to receive messages. The problem is when I put a message through this form Biztalk gives me this errror:
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: "RecPort" URI: "MQS://127.0.0.1/QM_svctag_2yj4k1s/default" Reason: No Disassemble stage components can recognize the data.
On the other hand when I put exactly the same message (By copying it), using the WebSphere MQ explorer, directly in the queue, it processes correctly using the same pipeline and orchestration and submits the message to the other WebSphere MQ queue. I am using XMLReceive and XMLTransmit as the pipelines.
When I look into the properties of the two messages using WebSphere MQ Explorer, I find the message data is exactly the same, so are most of the properties, the only two changes are the change in the application name which put the message (very obvious) and the message size, which in case of my application is exactly double the size, if we compare it to the message directly put in the queue.
I've wasted quiet a bit of time on this, but couldn't find any solution to this, I just cant understand why an exactly same message is processed by biztalk if it is directly put in the queue and cant be processed if it is done through an application.
Is there a way of writting the XmlDocument to WebSphere MQ or any better way of writing xml to it?
Plz Help me, I'll be very grateful
Regards,
Sajid. |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Sep 08, 2006 4:01 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Double in size, you say?
As if, perhaps, you wrote a double-byte character string to the message, instead of a single-byte character string? Isn't.... Unicode... a double-byte string?
Also, you're sure you set Format on the MQMD to MQFMT_STRING, right? _________________ I am *not* the model of the modern major general.
Last edited by jefflowrey on Sat Sep 09, 2006 5:17 am; edited 1 time in total |
|
Back to top |
|
 |
sajid08 |
Posted: Fri Sep 08, 2006 12:09 pm Post subject: |
|
|
Novice
Joined: 08 Sep 2006 Posts: 22 Location: Karachi
|
I am not too sure abt double or single byte character string, it is quiet simple like.
MQMessage.WriteString(XmlDoc.OuterXml);
OuterXml contains the whole xml message.
and yes I do declare its format as MQFTM_String. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Sep 08, 2006 3:10 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sajid08 wrote: |
MQMessage.WriteString(XmlDoc.OuterXml);
|
Review your M$ .NET information. This is unicode (UTF-16) and not (UTF-8 ).
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sajid08 |
Posted: Sat Sep 09, 2006 12:04 am Post subject: |
|
|
Novice
Joined: 08 Sep 2006 Posts: 22 Location: Karachi
|
Cheers!! That worked.
String is UTF-16 by default in .net and you cant change it, I convert the Encoding to UTF-8 by getting bytes from it and then use WriteByte() method to write and it worked all the right.
Thanks & Regards,
Sajid. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 09, 2006 2:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
sajid08 wrote: |
Cheers!! That worked.
String is UTF-16 by default in .net and you cant change it, I convert the Encoding to UTF-8 by getting bytes from it and then use WriteByte() method to write and it worked all the right.
Thanks & Regards,
Sajid. |
Not the right way to treat this. .NET has specific methods to convert to UTF-8.
Check out the methods they may have the word ASCII in it. Search the board this has been discussed before.
Or don't change anything and set the CCSID of the message to 1200 ?
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|