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 » ApplicationIdData in .NET

Post new topic  Reply to topic
 ApplicationIdData in .NET « View previous topic :: View next topic » 
Author Message
PeterPotkay
PostPosted: Thu Mar 11, 2004 2:45 pm    Post subject: ApplicationIdData in .NET Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

I can't get this to work.

5.3 CSD06
amqmdnet.dll Version 1.0.0.3

Quote:

An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index and count must refer to a location within the string.


This error is thrown at the RED line of code. If I comment out the red line, I can put a message to the queue succesfully, and the Identity Data Fields are in fact all blanked out, proving the the queue was open with the correct options to set those fields (ApplicationIdData is one of the Identity fields.). Yet I keep getting that error if I try to set the field.


Code:

myQM = New MQQueueManager(screenQMName, myHashTable) 'create a new QM object

      Dim queueName As String = "SYSTEM.DEFAULT.LOCAL.QUEUE"
            Dim mqQueue As MQQueue                  '* MQQueue instance
            Dim mqMsg As MQMessage                  '* MQMessage instance
            Dim mqPutMsgOpts As MQPutMessageOptions '* MQPutMessageOptions instance
            Dim msgLen As Integer                   '* Message length
            Dim message As String                   '* Message buffer

            Try
                mqQueue = myQM.AccessQueue(queueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING +                MQC.MQOO_SET_IDENTITY_CONTEXT)
            Catch mqError As MQException
                MessageBox.Show("open of queue failed" & mqError.ReasonCode)
            End Try

            message = "Hi"
            msgLen = message.Length

            '* put the next message to the queue
            mqMsg = New MQMessage
            mqMsg.WriteString(message)
            mqMsg.Format = MQC.MQFMT_STRING
            [color=red]mqMsg.ApplicationIdData = "TheApplIdDataField"[/color]
            mqMsg.Expiry = 55555
            mqMsg.ReplyToQueueName = "thisWorksWhyWontApplIdData"

            mqPutMsgOpts = New MQPutMessageOptions
            mqPutMsgOpts.Options = MQC.MQPMO_SET_IDENTITY_CONTEXT


            Try
                mqQueue.Put(mqMsg, mqPutMsgOpts)
            Catch mqError As MQException
                '* report the error
                MessageBox.Show("Put of message failed" & mqError.ReasonCode)
            End Try


If is use this line instead:
mqMsg.ApplicationIdData.Insert(0, "TheapplIDdata")
I don't error, and the message makes it to the queue, but the field is not set.

The manual states that their are get and set methods, but that is not true.


_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
JasonE
PostPosted: Fri Mar 12, 2004 4:33 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

Hmmm... I fixed this once... -)
http://www-1.ibm.com/support/search.wss?apar=include&q=IC38660

Are you sure (and I mean really sure...!) that the version being picked up at execute time is the fp6 and not the fp5 one. Please try removing it from the GAC and putting the fp6 one in. FP6 does not update the gac (nor will any future fixpack on 5.3) and hence the last one registered is the last one really used. (A real recipe for disaster, I know!)
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Mar 12, 2004 5:40 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Thanks Jason.

mqMsg.ApplicationIdData = "12345678901234567890123456789012"

worked, since the above string is exactly 32 bytes.

I then removed amqmdnet.dll from my Referances, and deleted it from my projects folder. I then readded it from the IBM directory.

mqMsg.ApplicationIdData = "JasonIsCool"
now works.

I could have sworn I reregistered the dll after the CSD06 upgrade. Come to think of it, most of my development in .NET has been on my home PC. I think I did it there and never got around to it at work.

Thanks Jason!
You get 5 points!
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
tamagawa
PostPosted: Fri Oct 01, 2004 3:29 pm    Post subject: still getting error after applying CSD07 Reply with quote

Novice

Joined: 09 May 2003
Posts: 13

I see the version for amqmdnet.dll is 1.0.0.3 for CSD07....I deleted the earlier versions from the gac, and added the version above, with no luck. any suggestions?

Thanks
Back to top
View user's profile Send private message
JasonE
PostPosted: Mon Oct 04, 2004 2:43 am    Post subject: Reply with quote

Grand Master

Joined: 03 Nov 2003
Posts: 1220
Location: Hursley

1.0.0.3 is the v5.3 version, not a specific fixpack version (otherwise you would have to rebuild your apps at every fixpack level!).

Unregister and reregister your amqmdnet.dll, and if it is still failing, paste a section of your code in here which is failing. Make sure you have installed the version with the fix in though, obviously (csd07 is currently the latest at the time of writing).
Back to top
View user's profile Send private message
tamagawa
PostPosted: Mon Oct 04, 2004 8:26 am    Post subject: Reply with quote

Novice

Joined: 09 May 2003
Posts: 13

reboot fixed it. thx
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 » ApplicationIdData in .NET
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.