create a agent(person) using genesys configuration SDK 8.0 from my .NET app

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"?>

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

You cant provide the DBID on creation, it gets allocated by Config Server once the object is created.

Thanks
Russell

2 Likes