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 » MQAX Dynamic Remote Queue Problem in VBScript

Post new topic  Reply to topic
 MQAX Dynamic Remote Queue Problem in VBScript « View previous topic :: View next topic » 
Author Message
ChrisCr
PostPosted: Mon Jul 21, 2003 7:11 am    Post subject: MQAX Dynamic Remote Queue Problem in VBScript Reply with quote

Newbie

Joined: 21 Jul 2003
Posts: 2

I am trying to write code in VBScript that will allow me to Get data from a message that includes the DynamicQueueName property and Put reply data to that Dynamic Queue. The Environment is that I have a Request coming in from an IBM Mainframe to a Windows 2000 Server. The Win2k box processes the request and puts a message back to a remote queue that has been setup with a channel. Here is a snippet of the code I am using:

Dim MQAXSession, QMgr, inQueue, outQueue, GetMsg, PutMsg
Dim CID, PutString,

'Open up the MQ Session
Set MQAXSession = CreateObject ("MQAX200.MQSession")
Set QMgr = MQAXSession.AccessQueueManager ("QM_nyrofcs2ksatn01")
Set inQueue = QMgr.AccessQueue("PSC.T1.REQUEST.QUEUE",1)
Set GetMsg = MQAXSession.AccessMessage

'Connect and get the CircuitID
QMgr.Connect
inQueue.Open
inQueue.Get(GetMsg)
CID = GetMsg.ReadString(GetMsg.MessageLength)

'<CID gets processed and reply data gets put in PutString>
PutString = "DummyData"

'Put the Message to the Outgoing Queue
Set outQueue = QMgr.AccessQueue("MQX1",16)
Set PutMsg = MQAXSession.AccessMessage
'outQueue.DynamicQueueName = GetMsg.ReplyToQueueName
'outQueue.RemoteQueueManagerName = "MQX1"
'outQueue.RemoteQueueName = GetMsg.ReplyToQueueName
outQueue.Open
PutMsg.WriteString PutString
outQueue.Put (PutMsg)

If I uncomment the lines in the Put Message section I get an error. If commented the message seems to go to the Remote Queue but doesn't appear in the proper Dynamic Queue on the Mainframe side. What exactly am I missing here? How can I Put that message into the proper queue?

Thanks very much for your time.

...Chris
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Jul 21, 2003 7:19 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You probably need to get and use the ReplyToQueueManagerName as well as the ReplyToQueueName.
Back to top
View user's profile Send private message
ChrisCr
PostPosted: Mon Jul 21, 2003 11:31 am    Post subject: Figured it out Reply with quote

Newbie

Joined: 21 Jul 2003
Posts: 2

For future reference (if anybody is ever using MQ with ActiveX or .asp) here is the code that worked for me:


'Put the Message to the Outgoing Queue
Set outQueue = QMgr.AccessQueue(GetMsg.ReplyToQueueName,16,"MQX1")
Set PutMsg = MQAXSession.AccessMessage
Set pmo = MQAXSession.AccessPutMessageOptions
outQueue.Open
pmo.Options = 4
PutMsg.Format = "MQSTR"
PutMsg.WriteString PutString
outQueue.Put PutMsg, pmo

Cheers!
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 » MQAX Dynamic Remote Queue Problem in VBScript
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.