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 API Support » MQIIH In VB6

Post new topic  Reply to topic Goto page 1, 2  Next
 MQIIH In VB6 « View previous topic :: View next topic » 
Author Message
BBuff
PostPosted: Tue Apr 11, 2006 11:39 am    Post subject: MQIIH In VB6 Reply with quote

Novice

Joined: 11 Apr 2006
Posts: 10

I've tried searching this valuable resource (and everything else Google will spit out at me) for an answer to this, but no luck thus far.

I'm trying to send a message via the bridge to IMS using VB6. I've got the MQIIH structure setup like this:

Dim iih As MQIIH

MQIIH_DEFAULTS iih
iih.LTermOverride = MQIIH_NONE
iih.Format = MQFMT_IMS_VAR_STRING
iih.MFSMapName = MQIIH_NONE
iih.ReplyToFormat = MQFMT_IMS_VAR_STRING
iih.Authenticator = g_user_id
iih.CommitMode = MQICM_SEND_THEN_COMMIT
iih.SecurityScope = MQISS_CHECK
---------------------------------------------------
I've got the Message Descriptor setup like this:

MQMD_DEFAULTS md

md.Expiry = MQEI_UNLIMITED
md.Report = MQRO_EXPIRATION_WITH_DATA + MQRO_EXCEPTION_WITH_DATA
md.MsgId = MQMI_NONE
md.ReplyToQMgr = qmgr
md.ReplyToQ = reply_queue
md.MsgType = MQMT_REQUEST
md.Format = MQFMT_IMS
md.UserIdentifier = g_user_id
md.PutApplType = MQAT_IMS_BRIDGE
md.Persistence = MQPER_PERSISTENT
md.ApplIdentityData = " "
----------------------------------------------------------
Problem is I can't see how the MQIIH structure is used via the MQPut method (or any other way for that matter). Once the MQPut is called I can go on the MF and look at the queue but the message isn't there.

I am by no means an MQ developer and have been asked to do this while my co-worker is out on vacation. Any insight you folks can provide on this will be greatly appreciated.

Thanks,
Brian
Back to top
View user's profile Send private message
wschutz
PostPosted: Tue Apr 11, 2006 11:49 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Can you post the code that actually does the PUT? Are you checking the return code from the put to ensure it worked?

What is the route between your VB application and IMS? For example, is your VB app using a client connection to the zOS qmgr or some other topology?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
BBuff
PostPosted: Tue Apr 11, 2006 12:26 pm    Post subject: Reply with quote

Novice

Joined: 11 Apr 2006
Posts: 10

Thanks for the fast reply Wayne. First, here's the MQPUT code:

MQPUT g_conn, g_obj_put, md, pmo, buflen, Buffer, comp_code, r_code

Both comp_code and r_code equal 0 following this call.

I don't know the answer to your route question. I would assume it is using a client connection. Is there something to look at that would tell me that answer? It seems as though everyone who knows anything about MQ is out today...figures. lol

Thanks again for the help,
Brian
Back to top
View user's profile Send private message
JT
PostPosted: Tue Apr 11, 2006 12:54 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Quote:
Once the MQPut is called I can go on the MF and look at the queue but the message isn't there.

Unless OTMA was stopped, you wouldn't expect the message to be sitting in the queue. As a normal course of action it would have 'triggered' the IMS transaction, which in turn would have consumed the message.
Back to top
View user's profile Send private message
EddieA
PostPosted: Tue Apr 11, 2006 1:52 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
Problem is I can't see how the MQIIH structure is used via the MQPut method

Quote:
MQPUT g_conn, g_obj_put, md, pmo, buflen, Buffer, comp_code, r_code

The buffer in the MQPUT, Buffer, should contain the IIH followed by the application data. MQ does not "chain" the headers for you. It treats everything except the MQMD as "payload", and expects the application to build it correctly.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
BBuff
PostPosted: Tue Apr 11, 2006 5:23 pm    Post subject: Reply with quote

Novice

Joined: 11 Apr 2006
Posts: 10

Thanks JT. I will ask the team that I'm doing this for to provide me a transaction to test with instead of my dummy one.

JT wrote:
Quote:
Once the MQPut is called I can go on the MF and look at the queue but the message isn't there.

Unless OTMA was stopped, you wouldn't expect the message to be sitting in the queue. As a normal course of action it would have 'triggered' the IMS transaction, which in turn would have consumed the message.
Back to top
View user's profile Send private message
BBuff
PostPosted: Tue Apr 11, 2006 5:26 pm    Post subject: Reply with quote

Novice

Joined: 11 Apr 2006
Posts: 10

Thanks Eddie. Here's a question for you. I notice in several samples, all Java I believe, that the IIH header was included in the message using writeString. Since this doesn't exist in VB should I be prepending the IIH information to the front of the message manually and not using the MQIIH structure? I guess what I don't really get is that I declare the MQIIH structure and set it up yet it's not used anywhere else in the code. Thanks for all of the help.

EddieA wrote:
Quote:
Problem is I can't see how the MQIIH structure is used via the MQPut method

Quote:
MQPUT g_conn, g_obj_put, md, pmo, buflen, Buffer, comp_code, r_code

The buffer in the MQPUT, Buffer, should contain the IIH followed by the application data. MQ does not "chain" the headers for you. It treats everything except the MQMD as "payload", and expects the application to build it correctly.

Cheers,
Back to top
View user's profile Send private message
EddieA
PostPosted: Tue Apr 11, 2006 11:36 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Unfortunately, my knowledge of VB consists of knowing that it's some sort of programming language that's spelt by having the letter "V", followed by the letter "B". So I really can't be much help as to how you constuct a single "buffer" consisting of an IIH followed by the application data. Sorry.

Hopefully, one of the more VB literate folks can chime in here. Please.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 12, 2006 12:03 am    Post subject: Reply with quote

Grand High Poobah

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

Hi BBuff,

You're quite right - the IIH header needs to be manually prepended. The only header which MQ deals with itself is the MQMD (as EddieA correctly points out). Everything else in MQ terms is payload and is under the control of the application. So setting up the structure is fine, but you need a few lines of extra code.

Good fortune in all your endevours.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
BBuff
PostPosted: Wed Apr 12, 2006 3:53 am    Post subject: Reply with quote

Novice

Joined: 11 Apr 2006
Posts: 10

If I follow you correctly then I don't even need to populate the structure. I simply need to prepend the structure to the message, right?

Vitor wrote:
Hi BBuff,

You're quite right - the IIH header needs to be manually prepended. The only header which MQ deals with itself is the MQMD (as EddieA correctly points out). Everything else in MQ terms is payload and is under the control of the application. So setting up the structure is fine, but you need a few lines of extra code.

Good fortune in all your endevours.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 12, 2006 4:05 am    Post subject: Reply with quote

Grand High Poobah

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

Sorry if I've mislead you. The structure does need to be populated, using the DEFAULTS construct will be fine, in the manner of the code you've already posted.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
BBuff
PostPosted: Wed Apr 12, 2006 4:52 am    Post subject: Reply with quote

Novice

Joined: 11 Apr 2006
Posts: 10

So I have to do both? How then is the structure used if it's not referenced? You wouldn't happen to have a sample laying around would you?

Thanks so much for your time.

Vitor wrote:
Sorry if I've mislead you. The structure does need to be populated, using the DEFAULTS construct will be fine, in the manner of the code you've already posted.
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 12, 2006 5:21 am    Post subject: Reply with quote

Grand High Poobah

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

The structure is used internally by the bridge when the message is picked off, not unlike an RFH2 header.

The only code sample I had for the bridge was lost to me 3 jobs and 5 laptops ago (!)
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
BBuff
PostPosted: Wed Apr 12, 2006 5:39 am    Post subject: Reply with quote

Novice

Joined: 11 Apr 2006
Posts: 10

Gotcha. Thanks for all of the help.

Vitor wrote:
The structure is used internally by the bridge when the message is picked off, not unlike an RFH2 header.

The only code sample I had for the bridge was lost to me 3 jobs and 5 laptops ago (!)
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Apr 12, 2006 6:00 am    Post subject: Reply with quote

Grand High Poobah

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

With luck, some other kind person has a sample.....

Anyone.....?
_________________
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 Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » MQIIH In VB6
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.