Is it possible to get the parameter name (where I have parmName below)? Or perhaps in the MSIL code there are only relative positions, no absolute parm names?
I have an unusual case using HIP within Microsoft Host Integration Server. When fields are NULL and the error goes back to CICS (on the mainframe), the error is "A CALL TO VERIFYINVOKEPARAMS FAILED". I have hard-coded a solution, but was trying to make a general solution that would work for any HIP subroutine.
Thanks,
Neal Walters
// check for null values in any of the parameters
MethodBase method = MethodBase.GetCurrentMethod();
//string key = method.Name + "(";
for (int i = 0; i < method.GetParameters().Length; i++)
{
if (method.GetParameters().GetValue(i).GetType() == typeof(String))
{
if (method.GetParameters().GetValue(i) == null)
{
string parmName = " Parm #" + i;
msg = "Value of return variable " + parmName + " is null (should be blanks)";
System.Diagnostics.EventLog.WriteEntry("LOGGER", msg,
System.Diagnostics.EventLogEntryType.Error);
}
}
}
Extra info: I'm calling a BizTalk Orch published as a WCF web service. When it gets errors, some fields are not serialzied back to the above program. This is how the values got to be NULL in the first place. But the CICS/application that is calling my HIS/HIP program doesn't like nulls.