Author |
Message
|
klabran |
Posted: Fri Mar 12, 2004 8:44 am Post subject: XML and write string VB.Net |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Do you have to do anything special when reading in an xml message from a text file into a string value and then putting that to a queue using the VB.Net MQ library.
I am creating an mqmessage, setting the format to string, using writestring to add it to the mqmessage and then using the put method of a queue.
I am getting an invalid document structure error?
Grabbing the message from my dead q shows a well structured xml message???
If I use mqsiputc to put the same message it works???
My queue recieving this message is set to use the xml parser. |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Mar 12, 2004 9:19 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
If it works one way and not the other, run the amqsbcg program against the two messages and look for differences in the header. My guess would be something to do with what you specified for a message format. |
|
Back to top |
|
 |
klabran |
Posted: Fri Mar 12, 2004 10:12 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Thanks for the hint...
In doing this I have noticed that the message being put from .net is inserting a blank after every character???
HEX = <.C.I.T.A.T.I.O.N.S. ect....
Text = < C I T A T I O N S
The headers are identical from what I can see.
What would cause that....??? |
|
Back to top |
|
 |
klabran |
Posted: Fri Mar 12, 2004 10:51 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
If the .net string is unicode based would this cause the problem?
If so how do I change it to be ascii based? |
|
Back to top |
|
 |
brad_blackmon |
Posted: Fri Mar 12, 2004 8:02 pm Post subject: |
|
|
 Newbie
Joined: 04 Mar 2004 Posts: 4 Location: Washington, D.C.
|
Try setting the MQMessage.CharacterSet property before you call the WriteString() method. If you do nothing, will default 1200, which writes the string to the queue in unicode. However, if you set the CharacterSet property to 437 before you call the WriteString() method, it will write the string to the queue in ASCII text.
--Brad |
|
Back to top |
|
 |
klabran |
Posted: Wed Mar 17, 2004 9:33 am Post subject: |
|
|
 Master
Joined: 19 Feb 2004 Posts: 259 Location: Flagstaff AZ
|
Thanks Brad. That did the trick.
I feel silly.
Kevin |
|
Back to top |
|
 |
|