11 Replies Latest reply on Aug 15, 2012 11:03 AM by Anne Brock

    Web Service, .NET, How to handle a NULL enum value?

      I am trying to help someone setup a C#.NET application to consume the HPD_IncidentInterface_WS/HelpDesk_QueryList_Service web service.  There are multiple enum fields with this operation, if one of them does not have a value then a NULL value is returned which causes an exception to be thrown.


      Running the below code throws an exception with this information:  {"Instance validation error: '' is not a valid value for Reported_SourceType."}



      HPD_IncidentInterface_WSService ws = new DEV_HPD_IncidentInterface_WS.HPD_IncidentInterface_WSService();


      AuthenticationInfo auth = new DEV_HPD_IncidentInterface_WS.AuthenticationInfo();

      auth.userName =


      auth.password =



      ws.AuthenticationInfoValue = auth;


      string qualification = "";


      string startRecord = "";


      string maxLimit = "2";


      GetListOutputMapGetListValues[] ExistingValues = ws.HelpDesk_QueryList_Service(qualification, startRecord, maxLimit);


      Any ideas on how to fix?  Thanks in advance

        • 1. Re: Web Service, .NET, How to handle a NULL enum value?
          Carl Wilson


          you will need to place values in the qualification and startRecord variables.

          Here is a VB.NET code example:


                    Dim strSQL As String


                    ' // Declare variables for the HPD_IncidentInterface_WS


                    Dim AuthenticationInfo_Query As New HPD_IncidentInterface_WS.AuthenticationInfo


                    Dim HelpDesk_Modify_Query_Service As New HPD_IncidentInterface_WS.HPD_IncidentInterface_WSService


                    ' // Holds the returned values of the Query to the Help Desk form.


                    Dim Query_OutputMap() As HPD_IncidentInterface_WS.GetListOutputMapGetListValues


                    ' // Define Authentication Parameters for Submit and Query/Modify WS

                    AuthenticationInfo_Query.userName = "Demo"

                    AuthenticationInfo_Query.password = "password"


                    ' // Pass Authentication Info into Header in WS Query/Modify Call

                    HelpDesk_Modify_Query_Service.AuthenticationInfoValue = AuthenticationInfo_Query


                    strSQL = "'First Name' = " + """Bob"""


                    ' // Initate the WS Query using above qualification

                    Query_OutputMap = HelpDesk_Modify_Query_Service.HelpDesk_QueryList_Service(strSQL, 1, 1)



          You can use SoapUI to consume the Web Service and identify the required values and query string.

          • 2. Re: Web Service, .NET, How to handle a NULL enum value?

            The following fields are enumerators with the out of the box web Incident web services. Contact_Sensitivity, Impact, Priority, Reported_Source, Service_Type, Status, Status_Reason, Urgency, VIP.  In the Remedy application one of those fields will not necessarily have a value, for example Reported_Source is not a required field.  Since the enum field is blank it returns a blank value in C#.  C# does not know how to handle it since the enum list does not have a blank value.

            Here is the auto-populated enum information, a blank value is not an option causing the exception to be thrown:



            GeneratedCodeAttribute("System.Xml", "2.0.50727.3053")]






            public enum Reported_SourceType {



            /// <remarks/>


            XmlEnumAttribute("Direct Input")]




            /// <remarks/>




            /// <remarks/>


            XmlEnumAttribute("External Escalation")]




            /// <remarks/>




            /// <remarks/>


            XmlEnumAttribute("Self Service")]




            /// <remarks/>


            XmlEnumAttribute("Systems Management")]




            /// <remarks/>




            /// <remarks/>


            XmlEnumAttribute("Voice Mail")]




            /// <remarks/>


            XmlEnumAttribute("Walk In")]




            /// <remarks/>




            /// <remarks/>




            /// <remarks/>


            XmlEnumAttribute("BMC Impact Manager Event")]



            • 3. Re: Web Service, .NET, How to handle a NULL enum value?

              Any advice on this posting? Same issue here. C# calling the web service.

              I am using the default web service that was installed with Incident management.



              • 4. Re: Web Service, .NET, How to handle a NULL enum value?

                We had to modify the OOB settings.  We changed the properties for the Reported_Source and Status_Reason fields to:

                MaxOccurs = 1

                MinOccurs = 0

                Nillable = true


                You might notice another problem.  For string fields, the default settings are for "unbound".  If you open the field just to view the properties then it will reset the field to actually make it unbound.  This changes the string to an array.  For those fields, we change "unbound" to "1". 


                Let me know if you have other questions.

                Thanks, Brian

                • 5. Re: Web Service, .NET, How to handle a NULL enum value?

                  Sorry, Very much a newbie to Remedy. OOB settings?

                  • 6. Re: Web Service, .NET, How to handle a NULL enum value?

                    OOB = Out Of Box

                    Remedy Developer Studio will need to be used to update the HPD_IncidentInterface_WS web service.

                    • 7. Re: Web Service, .NET, How to handle a NULL enum value?

                      Thank you. I will look into that.

                      • 8. Re: Web Service, .NET, How to handle a NULL enum value?

                        Thanks for the push in the right direction. For anybody else following this thread I used the Remedy Administrator

                        to make the changes above, so looks like there are at least 2 valid paths to accomplish this.

                        thanks again.


                        • 9. Re: Web Service, .NET, How to handle a NULL enum value?

                          Remedy Administrator was replaced with Remedy 7.5, it now uses Remedy Developer Studio. 

                          • 10. Re: Web Service, .NET, How to handle a NULL enum value?

                            any one can please send the final steps to solve the problem, i have the same problem and i can't solve it

                            • 11. Re: Web Service, .NET, How to handle a NULL enum value?
                              Anne Brock

                              NOTE: I deleted the duplicate postings on this thread.