Author |
Message
|
gotiashvili |
Posted: Tue May 27, 2008 5:34 am Post subject: Flow dosen't understand XML file written by C# application.. |
|
|
Newbie
Joined: 02 Apr 2008 Posts: 8
|
Hello
I have C# application. I want to write XML string in a Queue.
Here is my C# code:
MQQueueManager mqQMgr;
MQQueue mqQueue1;
MQMessage mqMsg1;
MQPutMessageOptions mqPutMsgOpts;
mqQMgr = new MQQueueManager("QM1");
mqQueue1 = mqQMgr.AccessQueue("LMB_INSERT",MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);
mqMsg1 = new MQMessage();
mqMsg1.WriteString(this.MessagetextBox.Text);
mqMsg1.Format = MQC.MQFMT_STRING;
mqPutMsgOpts = new MQPutMessageOptions();
mqQueue1.Put(mqMsg1, mqPutMsgOpts);
I'm trying to put a simple XML message.
For example:
<XMLRoot>
<a>aaa</a>
</XMLRoot>
This message is succesfuly written in a Queue but Message broker couldn't understand that this is XML format. When I debug this flow I have this error:
Message
Properties
MQMD
XMLNS
XML Parsing Errors have occurred
Then I've terminated debuging and got the message with rfhutil.exe.
There was the same XML witch I wrote from C#.
Then I put the same message with rfhutil.exe and everything is ok.
Can anyone tell me why Message Flow couldn't understend XML message written by C# app ??
Thanks in advance. |
|
Back to top |
|
 |
yaakovd |
Posted: Tue May 27, 2008 6:52 am Post subject: |
|
|
Partisan
Joined: 20 Jan 2003 Posts: 319 Location: Israel
|
Try to check HEX using RFH Util - it must be some special character (e.g. x'00') at the end of your xml _________________ Best regards.
Yaakov
SWG, IBM Commerce, Israel |
|
Back to top |
|
 |
kimbert |
Posted: Tue May 27, 2008 10:52 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
Can anyone tell me why Message Flow couldn't understend XML message written by C# app |
The error message will probably tell you, once you work out how to find it
Disconnect the debugger and either
a) look in the system log
b) look at the ExceptionList tree
c) take a user trace
Any of those will show you the full text of the error. |
|
Back to top |
|
 |
kirank |
Posted: Tue May 27, 2008 1:33 pm Post subject: |
|
|
 Centurion
Joined: 10 Oct 2002 Posts: 136 Location: California
|
I had similar experience recently for a C# application. Check if the CCSID is being set to 1208 in C# program. That was the issue in my case.
Regards
Kiran |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 27, 2008 6:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
.NET by default writes in Unicode ( CCSID 1200). So you would have to set the CCSID on the message or use the corresponding .NET System method to transform the String into ASCII before writing it to the message. The default CCSID of the platform (and the qmgr?) of 437 would then be fine.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
gotiashvili |
Posted: Wed May 28, 2008 12:48 am Post subject: |
|
|
Newbie
Joined: 02 Apr 2008 Posts: 8
|
Thank you for your responses.
I've only changed
mqMsg1.WriteString(this.MessagetextBox.Text);
to
mqMsg1.WriteBytes(this.MessagetextBox.Text);
and it helped.
Thanks  |
|
Back to top |
|
 |
|