CA Service Management

 View Only
  • 1.  Error - could not get attribute cache UDS Attribute on add request

    Posted Jun 28, 2016 07:26 AM

    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();

            }



  • 2.  Re: Error - could not get attribute cache UDS Attribute on add request
    Best Answer

    Posted Jun 28, 2016 08:42 AM

    I resolved by replacing this line

     

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

     

    for this

    string cr_result = usd.createRequest(sessionID, userHandle, attrVal, prop, "", new string[] { "id" }, ref requestHandle, ref requestNumber);

                   

     

     



  • 3.  Re: Error - could not get attribute cache UDS Attribute on add request

     
    Posted Jun 28, 2016 11:54 AM

    Thanks for letting everyone know you were able to resolve and sharing the answer ianprogrammer!



  • 4.  Re: Error - could not get attribute cache UDS Attribute on add request

    Posted Sep 12, 2017 04:23 PM

    Thank you very much ianprogrammer !

    Exactly what I needed. 

    #-2146233087 #uds