Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 8th, 2005, 07:18 PM
Authorized User
 
Join Date: Aug 2004
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to macupryk Send a message via Yahoo to macupryk
Default System.Reflection Error. Parameter count mismatch

I get a parameter count mistmatch.

This is my xml file:

                                                <MaxThreadCount>1</MaxThreadCount>
               <ComponentName>ClaimDocument</ComponentName>
               <ClassName>ZurichNA.CWSImport.ClaimDocument.Clai m</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("DBConn ectionString"))
            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.GetProcessPacka geXML, objConnection, m_blnUpdateRetryFlag)
                UpdateDocumentDataAndFile(objPkg.GetProcessPackage XML, 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.


Knowledge is to be shared.
__________________
Knowledge is to be shared.





Similar Threads
Thread Thread Starter Forum Replies Last Post
System.InvalidCastException; System.Reflection.Tar Jophie BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 January 16th, 2008 03:29 PM
System.Reflection.AmbiguousMatchException: Ambiguo vikas.gupta .NET Framework 2.0 1 June 28th, 2007 08:20 AM
Using System.Reflection maxl Pro Visual Basic 2005 0 March 21st, 2007 05:42 PM
Reflection -:System.IO.FileNotFoundExc,3rd edition kal2na2 BOOK: Professional C#, 2nd and 3rd Editions 0 February 10th, 2006 01:13 AM
Reflection -VectorClass :System.IO.FileNotFoundExc kal2na2 C# 1 February 9th, 2006 10:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.