System.Reflection Error. Parameter count mismatch.

macupryk

Member
Joined
Apr 8, 2005
Messages
8
Programming Experience
10+
I get a parameter count mistmatch.

This is my xml file:

<MaxThreadCount>1</MaxThreadCount>
<ComponentName>ClaimDocument</ComponentName>
<ClassName>ZurichNA.CWSImport.ClaimDocument.Claim</ClassName>
<MethodName>Import</MethodName>
<SuccessfulQueueStatusCode>5</SuccessfulQueueStatusCode>
<CheckForRetry>false</CheckForRetry>


Public Sub Run()
Dim objAssbly As System.Reflection.Assembly
Dim objComponent As Object
Dim objType As Type
Dim componentMethod As MethodInfo
Dim args() As Object
Dim objPkg As Package
Dim objRtn As Object
Dim objConnection As New SqlConnection(m_objAppSettings.AppSettings("DBConnectionString"))
Dim intCompleted As Integer = 0
Dim objPkgError As PackageError
Dim aCorrelationID(24) As Byte
Dim intRetryCount As Integer
Dim m_blnUpdateRetryFlag As Boolean = False
Dim blnIsNotifFlag As Boolean = False

''<new>
'Dim objMsg As IBM.WMQ.MQMessage
''</new>

Try
''<new>
'm_objMQ = New MQUtils(m_strQueueManagerName, m_strGetQueueName, m_strPutQueueName)
'objMsg = m_objMQ.GetMsg(m_intWaitInterval, True, False, False)
'get the message
m_objMQMgr = New IBM.WMQ.MQQueueManager(m_strQueueManagerName)
m_strMsgXML = GetMessage()

'make the call to the corresponding component
objAssbly = System.Reflection.Assembly.Load(m_strComponentName)
objType = objAssbly.GetType(m_strComponentClassName)
componentMethod = objType.GetMethod(m_strComponentMethodName)

objComponent = Activator.CreateInstance(objType)

ReDim args(0)
''<new>
'args(0) = objMsg.ReadString(objMsg.MessageLength)
args(0) = m_strMsgXML

objRtn = componentMethod.Invoke(objComponent, args)

'load the returned XML into a new Package
objPkg = New Package(CType(objRtn, String))

' check for critical errors, if one exists move the message directly to the notification queuue
If objPkg.ErrorSeverityCode = m_objGeneral.ErrorSeverity.Critical Then

If m_strPutQueueName = "NONE" Then
blnIsNotifFlag = True
End If

m_strPutQueueName = m_strErrorQueue
'If m_blnRetryFlag Then
m_blnUpdateRetryFlag = True
'Get the retry count
intRetryCount = GetRetryCount(objPkg.ProcessID, objPkg.ProcessPackageID, objConnection)

If intRetryCount > 0 Then
If blnIsNotifFlag Then
m_strPutQueueName = "NONE"
Else
m_strPutQueueName = m_strNotificationQueue
End If
End If
End If

'open connection
If objConnection.State = ConnectionState.Closed Then
objConnection.Open()
End If

'log any unlogged errors
If objPkg.HasUnloggedErrors Then
For Each objPkgError In objPkg.Errors
If Not objPkgError.LoggedFlag Then
LogError(objPkgError, objPkg.ProcessID, objPkg.ProcessPackageID, objConnection)
objPkgError.LoggedFlag = True
End If

Next
End If

'Update Process, Package and File in the DB
UpdateProcessDataAndPackage(objPkg.GetProcessPackageXML, objConnection, m_blnUpdateRetryFlag)
UpdateDocumentDataAndFile(objPkg.GetProcessPackageXML, objConnection)
If Convert.ToDouble(objPkg.CurrentStatusCode) = m_objGeneral.Status.ProcessingFinished Then
UpdateAllStatusToComplete(objPkg.ProcessID, objConnection)

' copy the control file to error directory
If objPkg.Errors.Count > 0 Then

End If
ArchieveFiles(objPkg.GetProcessPackageXML, objConnection)
End If

objConnection.Close()


If m_strPutQueueName <> "NONE" Then
objPkg.CurrentStatusCode = CType(m_intQueueStatusCode, String)

PutMessage(objPkg.GetProcessPackageXML)

End If

m_objForm.txtInfo.AppendText(vbCrLf & Now.ToString & " Message for: " & m_strComponentName & " has been processed.")
m_intCompleted = 1
Catch mqEx As MQException
m_intCompleted = 1

HERE IS THE ERROR BEING CATCH *****************************************
Parameter count mismatch.
******************************************************************
Catch ex As Exception
m_strTemp = Convert.ToString(ex.Message)
m_objForm.txtErrorLog.Text = m_objForm.txtErrorLog.Text & vbCrLf & Now.ToString & " " & m_strTemp
RaiseEvent LogMHError(ex, "Controller.MessageHandler.Run")
m_intCompleted = 0

m_objMQMgr.Backout()

Finally
m_objMQMgr.Commit()
m_objMQMgr.Disconnect()

RaiseEvent Completed(m_intCompleted, m_GUID)

End Try

End Sub


My Module name is class library is ClaimDocument and the module is Claim.vb
The method being called in Claim is called Import.

Now if I right click on the properties of the the module?
Assembly name: ClaimDocument
Root name space is : ZurichNA.CWSImport.ClaimDocument

Can someone help me out with this error. I would appreciate any help.
 
Top Bottom