" /> How to get login config error (platform sdk 8.5) - Genesys CTI User Forum

Author Topic: How to get login config error (platform sdk 8.5)  (Read 3019 times)

Offline Alyw

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
How to get login config error (platform sdk 8.5)
« on: June 21, 2015, 07:10:33 AM »
Advertisement
Hi, I'm new in developing windows application (using C#.NET) with genesys products. I was able to connect to config server and t-server, but the problem is how can I catch the login error when user enter wrong login details and prompt a message with the stated error? Here's my code:

confServerProtocol = new ConfServerProtocol(new Endpoint(new Uri("tcp://" + Host + ":" + Port)));
confServerProtocol.UserName = UserName;
confServerProtocol.UserPassword = Password;
confServerProtocol.ClientName = Application;
confServerProtocol.ClientApplicationType = (int)CfgAppType.CFGAgentDesktop;

try
{
confServerProtocol.Open();
}

catch (ProtocolException ex)
{
//Catch and display error
}

Is it correct to use ProtocolException to catch the error? How can I related it with CfgErrorType? I've gone through the developer guide but I still have no idea how to implement.     


Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: How to get login config error (platform sdk 8.5)
« Reply #1 on: June 22, 2015, 07:54:21 AM »
Are you using sync or async access to the confserv? In sync, on your request login you should receive Event(ACK/Error/etc.), from which you can find out the result.

Offline Alyw

  • Newbie
  • *
  • Posts: 20
  • Karma: 0
Re: How to get login config error (platform sdk 8.5)
« Reply #2 on: June 23, 2015, 02:59:11 AM »
Hi Kubig, thanks for the response. May I know how can I use sync operation in this case? Based on what I've done, I can only catch the error under ProtocolException. For example, if the connection uri is incorrect, it will return: [psdkendpoint@testing:2020@testing:2020] Error opening connection. By the way, the error is displayed in console output.