title: .NET Reflection of all method parameters
body: <p>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? </p>
  
  <p>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. </p>
  
  <p>Thanks,</p>
  
  <p>Neal Walters </p>
  
  <pre><code>    // check for null values in any of the parameters 
      MethodBase method = MethodBase.GetCurrentMethod();
      //string key = method.Name + "(";
      for (int i = 0; i &lt; 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);
  
              }
          }
      }
  </code></pre>
  
  <p>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. </p>
  
  <p>NOTE: 
     The follow-up question on how to get the values is here: 
  <a href="https://stackoverflow.com/questions/1867482/c-sharp-getting-value-of-parms-using-reflection">C# Getting value of parms using reflection</a></p>