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 » General IBM MQ Support » Problem sending from windows to Unix

Post new topic  Reply to topic
 Problem sending from windows to Unix « View previous topic :: View next topic » 
Author Message
PaulHolmes
PostPosted: Wed Apr 23, 2014 6:58 am    Post subject: Problem sending from windows to Unix Reply with quote

Newbie

Joined: 23 Apr 2014
Posts: 4

I have written a .net service to pull records from a db into an XML string and then post them to a MQ queue.

This has worked ok untill the broker in the middle was removed and I now send directly to a unix box.

My research has shown that the Unix machine is expecting

Encoding 273
CodedCharSetID 819

The code to send this doesnt set any parameters to set this enocding, and is as below. How do I set the encoding and CodedCharSetID variables?

Dim queueManager As MQQueueManager
Dim mqMsg As MQMessage
Dim queueOut As MQQueue
Dim mqPutMsgOpts As MQPutMessageOptions

Try
queueManager = New MQQueueManager(My.Settings.mqmanager)
queueOut = queueManager.AccessQueue(My.Settings.mqsendq, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING)

Catch ex As Exception
clData.AddErrorToMail("Failed to connect to Send to: " + My.Settings.mqmanager + " Error: " + ex.Message)
End Try

For Each dItem In clData.Requestlist
'send message into MQ

Try
mqMsg = New MQMessage()
mqMsg.WriteString(dItem.message)
mqMsg.Format = MQC.MQFMT_STRING
mqPutMsgOpts = New MQPutMessageOptions()

queueOut.Put(mqMsg, mqPutMsgOpts)

Catch ex As Exception
clData.AddErrorToMail("Failed to SEND message: " + ex.Message)
End
End Try
Next
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 23, 2014 7:13 am    Post subject: Re: Problem sending from windows to Unix Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PaulHolmes wrote:
How do I set the encoding and CodedCharSetID variables?


Are you sure this will help? If your .NET code is sending the message as (for example) UTF-16 then simply setting the CCSID to 819 will not magically turn your double byte Unicode into single byte ISO Latin.

The better option is to leave your code as it is (or set the CCSID in the MQMD to answer your orginal question) and have the receiving application specify conversion when they get the message from the queue. This will magically turn the message into the 819 they're expecting, irrespective of what your .NET is using.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 23, 2014 7:16 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

But remember, when you set the CCSID in your header you're describing your message's code page not converting it. If you actually want to write a message in 819 you'll need specific code which has nothing to do with WMQ to achieve that.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PaulHolmes
PostPosted: Wed Apr 23, 2014 7:38 am    Post subject: Reply with quote

Newbie

Joined: 23 Apr 2014
Posts: 4

Thanks for the advice, I have used syntax
mqMsg.CharacterSet = 819
mqMsg.Encoding = 273
but now have to wait to see if the message has been recieved as the destination people have gone home for the day.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 23, 2014 8:12 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PaulHolmes wrote:
Thanks for the advice, I have used syntax
mqMsg.CharacterSet = 819
mqMsg.Encoding = 273
but now have to wait to see if the message has been recieved as the destination people have gone home for the day.


Which describes your message as being in ISO Latin. If it's not, and I bet it's not or they wouldn't be having trouble, this will not help.

Plus my limited .NET knowledge indicates another issue.

But we'll see. I've been known to be wrong & I'm under quota on mistakes today.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Apr 23, 2014 8:34 am    Post subject: Re: Problem sending from windows to Unix Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

PaulHolmes wrote:
I have written a .net service to pull records from a db into an XML string and then post them to a MQ queue.

This has worked ok untill the broker in the middle was removed and I now send directly to a unix box.

What did the broker do to the input before sending it to the queue? What kinds of transformations?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
PaulHolmes
PostPosted: Wed Apr 23, 2014 9:40 am    Post subject: Reply with quote

Newbie

Joined: 23 Apr 2014
Posts: 4

The broker recieved the encoding and codedcharsetid of 546 and 1200 and transformed it into 273 and 819.

The new path removing the broker has led to the problem, and the reciever is not able to change the code at the recievor end as it is 1 of a few imports by the poller at the distant end.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 23, 2014 9:45 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PaulHolmes wrote:
The broker recieved the encoding and codedcharsetid of 546 and 1200 and transformed it into 273 and 819.


What you've set in your code will not reproduce that transformation. It will change the description of the message but the payload (your string) will not magically (or automagically) recode into 819. As I mention above.

PaulHolmes wrote:
the reciever is not able to change the code at the recievor end as it is 1 of a few imports by the poller at the distant end.


They don't need to change the code; they need to change 1 option (which they should have set anyway) that will be invisible to their code and will fix their problem. Automagically.

Alternatively (and very much as a 2nd choice) your WMQ administrators could configure the channel that links you to perform the conversion for you. I'm assuming a queue manager to queue manager channel as there used to be a broker in the mix.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
PaulHolmes
PostPosted: Thu Apr 24, 2014 2:46 am    Post subject: Reply with quote

Newbie

Joined: 23 Apr 2014
Posts: 4

Quote:

they need to change 1 option

As you suspected setting the header didn't work. The Q manager has got it working using "QM is set to convert(yes)"

Thanks for your help.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 24, 2014 4:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

PaulHolmes wrote:
The Q manager has got it working using "QM is set to convert(yes)"


That's the 2nd option I mention above. Be aware this is somewhat non-optimal & can cause issues if you ever send anything which isn't a plain string.

But I'm glad you have your current problem solved.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » General IBM MQ Support » Problem sending from windows to Unix
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.