Posted: Wed Feb 09, 2005 10:49 am Post subject: Channel Status PCF Error on VB.NET
Novice
Joined: 20 Jan 2005 Posts: 15
I tried to port over the Java code to do this. I am trying to get the channel status using VB.NET CSD08 - I can't tell if it is a coding error or the functionality that I am using is incomplete.
Here is the information from the exception when the Send method is executed.
Error: 2/9/2005 1:45:31 PM- Message:Unknown type
Error: 2/9/2005 1:45:31 PM- Stack Trace: at IBM.WMQ.PCF.PCFParameter.NextParameter(MQMessage message)
at IBM.WMQ.PCF.PCFMessage..ctor(MQMessage message)
at IBM.WMQ.PCF.PCFMessageAgent.Send(PCFMessage request, Boolean check)
at IBM.WMQ.PCF.PCFMessageAgent.Send(PCFMessage request)
Any help would be really appreciated.
Public Sub ChannelStatus()
Dim targetName As String = "*"
' set up the PCF agent
Dim agent As PCFMessageAgent = New PCFMessageAgent
Dim responses() As PCFMessage
agent.Connect(MQM)
' build a request
Dim request As PCFMessage = New PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS)
' add a parameter designating the name of the channel for which status is requested
request.AddParameter(CMQCFC.MQCACH_CHANNEL_NAME, targetName)
' add a parameter designating the instance type (current) desired
request.AddParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE, IBM.WMQ.MQC.MQOT_CURRENT_CHANNEL)
' add a parameter designating the attributes desired, but first...
' ...build an array list of attributes desired
Dim attrs(5) As Integer
' ...now add the parameter for these attributes
request.AddParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS, attrs)
Dim i As Integer
Dim chlCount As Integer
Try
' send the request and collect the responses
responses = agent.Send(request)
For i = 0 To responses.Length - 1
' get the channel name and trim the spaces
Dim temp As String = responses(i).GetStringParameterValue(CMQCFC.MQCACH_CHANNEL_NAME)
Dim channelName As String = temp.Trim()
' get the channel name and trim the spaces
temp = responses(i).GetStringParameterValue(CMQCFC.MQCACH_CONNECTION_NAME)
Dim connectionName As String = temp.Trim()
' get the channel last message date/time
temp = responses(i).GetStringParameterValue(CMQCFC.MQCACH_LAST_MSG_DATE)
Dim lstMsgDate As String = temp.Trim()
temp = responses(i).GetStringParameterValue(CMQCFC.MQCACH_LAST_MSG_TIME)
Dim lstMsgTime As String = temp.Trim()
' get the channel current messages total
Dim totalMsgs As Integer = responses(i).GetIntParameterValue(CMQCFC.MQIACH_MSGS)
' get the channel status
Dim chlStatus As Integer = responses(i).GetIntParameterValue(CMQCFC.MQIACH_CHANNEL_STATUS)
If chlStatus <> CMQCFC.MQCHS_INACTIVE Then
' System.out.println(" chlStatus = " + chlStatus)
chlCount = chlCount + 1
End If
Next
Catch e As Exception
Logger.LogError("Message:" + e.Message)
Logger.LogError("Stack Trace:" + e.StackTrace)
Logger.LogError("Source:" + e.Source)
Catch pcfEx As PCFException
Logger.LogError(pcfEx.Message)
Finally
agent.Disconnect()
End Try
End Sub _________________ Mark Fuini
markfuini@yahoo.com
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