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 and VB

Post new topic  Reply to topic
 MQIIH and VB « View previous topic :: View next topic » 
Author Message
deuspi
PostPosted: Thu Jan 24, 2002 3:08 am    Post subject: Reply with quote

Newbie

Joined: 20 Jan 2002
Posts: 9
Location: Paris, France

Hey there,

I'm trying to communicate with a MQSeries serveur on a Open/VMS environment. I know that I have to send a header with my messages. I have a structure for that : MQIIH. The problem is that I don't know when and how I should send this structure, for there's no function you can provide a MQIIH structure when sending messages. Anyone knows what's wrong in my reasoning ?

Thanks,

Pierre

[ This Message was edited by: deuspi on 2002-01-24 03:08 ]
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu Jan 24, 2002 7:29 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7717

For what it's worth, we spent a lot of time trying to solve this problem (IIH headers out of VB) without any success. At this point, we just are living with the fact that our VB apps can't put to a Bridge queue. If you solve this, or anyone else knows how, please post.

_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
StefanSievert
PostPosted: Thu Jan 24, 2002 12:06 pm    Post subject: Reply with quote

Partisan

Joined: 28 Oct 2001
Posts: 333
Location: San Francisco

Guys,
that works like a charm, what were your problems there?
Pierre, why do you want to send an MQIIH structure to an Open/VMS server? Does it run IMS or will it forward the message to a /390?

Peter, the Visual Basic include file that comes with MQSeries contains the MQIIH structure definition:
'**********************************************************************'
'* MQIIH Structure -- IMS Information Header *'
'**********************************************************************'
Type MQIIH
StrucId As String*4 'Structure identifier'
Version As Long 'Structure version number'
StrucLength As Long 'Length of MQIIH structure'
Encoding As Long 'Reserved'
CodedCharSetId As Long 'Reserved'
Format As String*8 'MQ format name of data that follows MQIIH'
Flags As Long 'Flags'
LTermOverride As String*8 'Logical terminal override'
MFSMapName As String*8 'Message format services map name'
ReplyToFormat As String*8 'MQ format name of reply message'
Authenticator As String*8 'RACF password or passticket'
TranInstanceId As String*16 'Transaction instance identifier'
TranState As String*1 'Transaction state'
CommitMode As String*1 'Commit mode'
SecurityScope As String*1 'Security scope'
Reserved As String*1 'Reserved'
End Type

'Default Instance of MQIIH Structure'
Global MQIIH_DEFAULT As MQIIH

Use the Subroutine MQIIH_DEFAULTS to set the defaults and go from there or build your message step by step by coding a sequence of msg.writeXXXX commands:
msg.writeString(MQIIH_STRUC_ID)
msg.writeLong(MQIIH_VERSION_1)
msg.writeLong(MQIIH_LENGTH_1)
etc.
Make sure you use the right writeXXX method for the datatype you are writing to the message.
Then, and this is the tricky part, be sure that your length field(s) are exactly set to the right value. Following the MQIIH you will need the standard LLZZ fields, trancode, data. If your total message length doesn't match with your LL value, you'll get DLQ messages. The common feedback codes in those DLQ messages are
MQFB_DATA_LENGTH_ZERO = 291
MQFB_DATA_LENGTH_NEGATIVE = 292
MQFB_DATA_LENGTH_TOO_BIG = 293
MQFB_BUFFER_OVERFLOW = 294
MQFB_LENGTH_OFF_BY_ONE = 295
MQFB_IIH_ERROR = 296
MQFB_NOT_AUTHORIZED_FOR_IMS = 298
If 300 < feedback code < 399, then you have already gone past the bridge and encountered an IMS error.
I admit, it takes some experiments and much diligence, but it works. The Application Programming Guide contains a section on 'Writing MQSeries IMS Bridge applications'. It's worth reading. BTW, you don't have to send the MQIIH header to utilize the bridge. This is controlled via the md.Format field. See the docs for details. If somebody is interested I can probably dig out a sample. I've done this from within C, VB and LotusScript code. Once you get it right, it works just fine.
Let me know what your problems are and I might be able to help out.
Cheers,
Stefan

_________________
Stefan Sievert
IBM Certified * MQSeries

[ This Message was edited by: StefanSievert on 2002-01-24 12:08 ]
Back to top
View user's profile Send private message
deuspi
PostPosted: Fri Jan 25, 2002 7:43 am    Post subject: Reply with quote

Newbie

Joined: 20 Jan 2002
Posts: 9
Location: Paris, France

Well, thanks a lot for your help.

Actually I'm making evolutions on an existing Lotus Notes application. The part of the application that allows the communication with the MQSeries server must be translated into VB. I know that the MQSeries server is located on an OpenVMS environment, and the previous developers sent a MQIIH header with each message in order to communicate with the MQSeries IMS-bridge. Unfortunately, I don't own an OpenVMS so I can't test anything, I don't really have control on how that system works. I was persuaded that I had to send a header, and for now that's what's done.

So in order to start my development, I just set up a Win2k MQSeries server and I'm sending my messages to it.

I understand the fact that I must send a platform-specific header to my server, but I don't really know how : I know that a VB structure exists for MQIIH, I know how to set it up, but what I don't know is how to send it. All I can find in the doc is : when you send a message you have to provide a MQIIH structure. Doesn't explain how I'm supposed to.

What I can see in the LotusScript code is a bunch of "WriteString" and "WriteLong" into the MQMessage object. If I want to translate it into VB, I'll have to do the same. That's why I don't understand the interest of creating a structure if I have to "WriteString" and "WriteLong" all the properties embedded in it.
I would have been glad to see a method in the MQMessage class that allows me to include my MQIIH structure and which would transparently add the necessary header information before the data in my message. But there's none. So I've written a function that does it, but I'm afraid not to understand everything with the philosophy, because everyone seems not to have problems with that.

Here is my function :

Public Sub EnTeteIMS(Message As MQMessage, Header As MQIIH)
With Message
.WriteString (Header.StrucId)
.WriteLong (Header.Version)
.WriteLong (Header.StrucLength)
.WriteLong (Header.Encoding)
.WriteLong (Header.CodedCharSetId)
.WriteString (Header.Format)
.WriteLong (Header.Flags)
.WriteString (Header.LTermOverride)
.WriteString (Header.MFSMapName)
.WriteString (Header.ReplyToFormat)
.WriteString (Header.Authenticator)
.WriteString (Header.TranInstanceId)
.WriteString (Header.TranState)
.WriteString (Header.CommitMode)
.WriteString (Header.SecurityScope)
.WriteString (Header.Reserved)
End With
End Sub

I provide a MQMessage and my instanciated MQIIH and the Sub includes the header into the message. Am I right here or not ?

Hope I make myself clear...

Thanks for your help
Pierre
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 API Support » MQIIH and VB
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.