Author Topic: create a agent(person) using genesys configuration SDK 8.0 from my .NET app  (Read 5549 times)

Offline priyanka.jns

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Hi All,


I am trying to create a agent(person) using genesys configuration SDK 8.0 from my .NET application.

below is my code

string CfgServerUri = ConfigurationManager.AppSettings["CfgServerUri"].ToString();
            string AppName = ConfigurationManager.AppSettings["AppName"].ToString();
            string Username = ConfigurationManager.AppSettings["Username"].ToString();
            string UserPassword = ConfigurationManager.AppSettings["UserPassword"].ToString();

            // instanciate the protocol class
            mCfgProtocol = new ConfServerProtocol(
                new Endpoint(
                new Uri(CfgServerUri)
                )
                );

            mCfgProtocol.ClientApplicationType = (int)CfgAppType.CFGSCE;
mCfgProtocol.ClientName = AppName;
mCfgProtocol.UserName = Username;
mCfgProtocol.UserPassword = UserPassword;

// open the protocol
mCfgProtocol.Open();

            XmlReader reader = XmlReader.Create(TextBox1.Text);
            System.Xml.Linq.XDocument doc;
            try
            {
                doc = System.Xml.Linq.XDocument.Load(reader);
            }
            catch
            {
                //MessageBox.Show( "Unable to load XML input file!" );
                return;
            }

            // create the request for applications defined in config
            RequestCreateObject requestCreateObject = RequestCreateObject.Create((int)CfgObjectType.CFGPerson, doc);

            // make our request. THIS IS A BLOCKING OPERATION!
            IMessage msg = mCfgProtocol.Request(requestCreateObject);

            if (msg == null || msg.Id != EventObjectCreated.MessageId)
            {
                //MessageBox.Show( "Unable to create agent" );
            }

            // cast the message to EventObjectsRead
            EventObjectCreated evtObjectCreated = msg as EventObjectCreated;


The XML file format which i got fron internet which i suppose is for older version of genesys.

<?xml version="1.0" encoding="utf-8"?>
<ConfData>
  <CfgPerson>
      <DBID value="376" />
      <tenantDBID value="1" />
      <lastName value="jain" />
      <firstName value="amit" />
      <employeeID value="1223242356789" />
      <userName value="jd3" />
      <isAgent value="2" />
  </CfgPerson>
</ConfData>

When I am running this code, I am getting error

RequestCreateObject.Create((int)CfgObjectType.CFGPerson Failure to unpack the attribute [DBID], type : [CfgPerson], DBID : [0].

I think problem is with my XML...

Please help if someone knows about this error.

Thanks n Regards
Priyanka

Offline rpenney

  • Jr. Member
  • **
  • Posts: 64
  • Karma: 2
You cant provide the DBID on creation, it gets allocated by Config Server once the object is created.

Thanks
Russell