|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  MQAX Dynamic Remote Queue Problem in VBScript | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | ChrisCr | 
		  
		    
			  
				 Posted: Mon Jul 21, 2003 7:11 am    Post subject: MQAX Dynamic Remote Queue Problem in VBScript | 
				     | 
			   
			 
		   | 
		 
		
		   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 | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | jefflowrey | 
		  
		    
			  
				 Posted: Mon Jul 21, 2003 7:19 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   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 | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | ChrisCr | 
		  
		    
			  
				 Posted: Mon Jul 21, 2003 11:31 am    Post subject: Figured it out | 
				     | 
			   
			 
		   | 
		 
		
		   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 | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | 
		    
		   | 
		 
	   
	 | 
   
 
  
	     | 
	 | 
	Page 1 of 1 | 
   
 
 
 
  
  	
	  
		
		  
 
  | 
		  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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |