AnsweredAssumed Answered

Error - could not get attribute cache UDS Attribute on add request

Question asked by ianprogrammer on Jun 28, 2016
Latest reply on Sep 12, 2017 by MMJUNIOR

When trying to add a request error : Error - Unable to get the USD attribute to cache attributes
pops up.
Can someone help me ?
below is my code

 

public static void InserirChamado()

        {

            string userName = "Servicedesk";

            string passWd = "12345qwert!@#$%";

            string userHandle = "";

            string sumary = "Teste incident";

            string description = "Teste incident";

            string groupHandle = "";

            string categoryHandle = "";

            int sessionID = 0;

 

            WS_SDM.USD_WebServiceSoapClient usd = new WS_SDM.USD_WebServiceSoapClient();

            try

            {

                sessionID = usd.login(userName, passWd);

                userHandle = usd.getHandleForUserid(sessionID, userName);

 

 

                /* string [] userArr = new string [] {"first_name", "last_name", "access_type.sym",

                              "organization", "organization.name", "admin_org.name", "group_list.length" };

                 string objectValueResult = usd.getObjectValues(sessionID, userHandle, userArr);

                 */

 

 

                #region getGroupHandle

                string retornoXML = usd.doSelect(sessionID, "grp", "last_name = 'TCDF - 2º Nível de Atendimento'", 1, new string[] { "persistent_id" });

                XmlDocument doc = new XmlDocument();

                doc.LoadXml(retornoXML);

                groupHandle = doc.DocumentElement.SelectSingleNode("/UDSObjectList/UDSObject/Handle").InnerText;

 

 

                #endregion

 

 

                string categoryXML = usd.doSelect(sessionID, "pcat", "sym = 'SISTEMAS INTERNOS.SIGA'", 1, new string[] { "persistent_id" });

                XmlDocument categoryDoc = new XmlDocument();

                categoryDoc.LoadXml(categoryXML);

                categoryHandle = categoryDoc.DocumentElement.SelectSingleNode("/UDSObjectList/UDSObject/Handle").InnerText;

                string[] attrVal = new string[] {"customer", userHandle,

                                           "description", description, "type",

                                           "I","summary",sumary, "group", groupHandle};

 

                string[] attr = new string[1];

                attr[0] = "";

                string[] prop = new string[1];

                prop[0] = "";

 

 

                 string requestHandle = "";

                 string requestNumber = "";

 

                     //erro trigers the line below

                string cr_result = usd.createRequest(sessionID, userHandle, attrVal, prop, "", attr, ref requestHandle, ref requestNumber);

 

            }

            catch (Exception e)

            {

                Console.WriteLine(e.Message);

 

 

            }

            Console.ReadKey();

        }

Outcomes