Dim loType As Type = loWebService.GetType() Dim loInfo As System.Reflection.MethodInfo = loType.GetMethod(lcMethod) Dim loParameter(1) As Object loParameter(0) = Date.Today loParameter(1) = 5 lcXMLReturned = loInfo.Invoke(loWebService, loParameter)In this case, the method called requires a date and an integer. Keeping the same method, if I do this, it won't work:
Dim loType As Type = loWebService.GetType() Dim loInfo As System.Reflection.MethodInfo = loType.GetMethod(lcMethod) Dim loParameter(1) As Object loParameter(0) = Date.Today loParameter(1) = Val(lcParameterActual) lcXMLReturned = loInfo.Invoke(loWebService, loParameter)Even if lcParameterActual is equal to "5", making it Val(), won't work. During the Invoke(), I will obtain: