ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Writing an XML file to a remote QManager

Post new topic  Reply to topic
 Writing an XML file to a remote QManager « View previous topic :: View next topic » 
Author Message
Linda
PostPosted: Tue May 16, 2006 1:37 pm    Post subject: Writing an XML file to a remote QManager Reply with quote

Newbie

Joined: 12 May 2006
Posts: 7

I wrote a VB.NET (2.0) Windows Service application on my development computer which utilizes amqmdnet.dll. My development computer has Websphere Client 6.0 installed on it. The application ultimately writes an XML message to a remote QManager (on our server that has MQ Server 6.0 installed on it). The recipient of the data claims that the message has periods between each character (such as "<.?.x.m.l.v.e.r.s.i.o.n. and on and on). Because the message is transmitted immediately to the remote queue Manager, I wasn't able to look at it. So, I created a local queue on our MQ Server and placed the same XML data in the local queue. When browsing the message in the queue, I am able to see the XML data in the "Message Data" column and it looks fine. I even wrote the data to a text file from within my VB.NET application before writing it to the queue to see what it looks like and it was well-formatted. I am new to MQ Server and Client so excuse my ignorance! I think it is an encoding issue but I'm not sure how to rememdy this problem. Here is a brief snippet of code from my VB.NET application:
Dim msg as String
msg = File.ReadAllText(myfilenameandpathhere)
Dim qMsg as New MQMessage
qMsg.WriteString(msg)
I'm thinking that the qMsg.WriteString method is what may be putting the funky characters in my data but I don't know. Any suggestions?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue May 16, 2006 2:03 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

"<.?.x.m.l.v.e.r.s.i.o.n." your data is in Unicode format
"<?xml version...." your data is in a different single byte character code.

Make sure your data is all text and the message is either a javax.jms.TextMessage or the format is set to "MQSTR".

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Linda
PostPosted: Tue May 16, 2006 2:11 pm    Post subject: Writing an XML file to a remote QManager Reply with quote

Newbie

Joined: 12 May 2006
Posts: 7

Wow, thanks for the quick response. I'm not sure what you mean by "make sure the format is set to MQSTR". Would you please elaborate? Since I am using the MQMESSAGE class within my VB.NET application, would I set the format using a property in this class or something?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue May 16, 2006 2:16 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Hi Linda,

The format is a property of the MQMD header. As I am not using your programing language you will have to rely on experts using it or find out for yourself how to access it. (documentation)

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Tue May 16, 2006 5:03 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Linda, you are producing the message so that the MQMD.CCSID is equal to 1200, which means Unicode. That's the default for .NET. The receiving app doesn't know its Unicode, so it doesn't attempt to convert it, and thus sees all those little dots in between each char.

If you set the MQMD.FORMAT of the message object to string ("MQSTR ", there is a constant for it in the .NET IDE) as you are building the message object right before the put, then the receiving app can call their MQGET call with the Convert option. Then MQ will convert your data from 1200 into whatever code page they want, thus eliminating those little dots.

I ***think**, not sure, that you can also just specify a plain non Unicode CCSID like Windows 437 (set the MQMD.CCSID of the message object to 437) when building the message object, and the mesage will go to the queue without those dots, and be tagged as 437. But then the receiving app will still need to convert if it itself is not 437.

You're better off letting it default to 1200 on the put, setting the format to MQSTR, and letting the getter convert (receiver makes good).
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Linda
PostPosted: Tue May 16, 2006 5:25 pm    Post subject: Writing an XML file to a remote Reply with quote

Newbie

Joined: 12 May 2006
Posts: 7

Ok. I think I am getting on the right track. I began researching further after receiving a reply from another user (fjb_saper) who I would also like to thank for his advice. Just before you replied, I was looking at the Data page of the Message properties on our MQ Server and noticed the MQMD.CCID was set to 1200 and the MQMD.FORMAT was blank. (This particular message was put on the queue from my VB.NET app). Then I decided to put the same XML message on the queue using the MQ Explorer and noticed the CCID was set to 1208 and the FORMAT was set to "MQSTR"! I did find two properties in the MQMESSAGE class (.NET IDE) that I think will allow me to set the CCID and FORMAT for the message on the queue.
Thank you very much for your advice. It is good to know that I am headed in the right direction
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Writing an XML file to a remote QManager
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.