Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: benjamin on October 10, 2017, 01:11:15 PM

Title: PSDK Multiple connection to ConfServer
Post by: benjamin on October 10, 2017, 01:11:15 PM
Hi,

i have developed a webpage where i can specify the person id, and the java code behind make a connection to ConfServer for retrieve information about that person.

But if i launch two request at the same time, the second one go in error.

Anyone can help me?

The code that i have used for connect to CfgServer is this:

[code]
        ConfServerProtocol confServerProtocol = new ConfServerProtocol(new Endpoint("ConfServer","hostname",port));
    confServerProtocol.setClientApplicationType(CfgAppType.CFGSCE.asInteger());
    confServerProtocol.setClientName(clientname);
    confServerProtocol.setUserName(username);
    confServerProtocol.setUserPassword(password);
    IConfService confService = ConfServiceFactory.createConfService(confServerProtocol);
        confServerProtocol.open();
   
    CfgPersonQuery queryPerson = new CfgPersonQuery();
    queryPerson.setUserName(PersonId);
    Collection<CfgPerson> cfgPersons = confService.retrieveMultipleObjects(CfgPerson.class, queryPerson);
[/code]

The error is this:

[code]
java.lang.IllegalArgumentException: ConfService has already been created for this endpoint.
[/code]
Title: Re: PSDK Multiple connection to ConfServer
Post by: cavagnaro on October 10, 2017, 01:16:07 PM
The name maybe? Try to make it dynamic
Title: Re: PSDK Multiple connection to ConfServer
Post by: benjamin on October 10, 2017, 03:04:28 PM
[quote author=cavagnaro link=topic=10673.msg48462#msg48462 date=1507641367]
The name maybe? Try to make it dynamic
[/quote]the name of the EndPoint in confServerProtocol declaration or the name of the variable of confService?
Title: Re: PSDK Multiple connection to ConfServer
Post by: cavagnaro on October 10, 2017, 03:06:05 PM
The name at the endpoint declaration. That is what CfgServer knows, not your internal variable name


Enviado de meu E6633 usando Tapatalk
Title: Re: PSDK Multiple connection to ConfServer
Post by: benjamin on October 10, 2017, 03:12:18 PM
[quote author=cavagnaro link=topic=10673.msg48464#msg48464 date=1507647965]
The name at the endpoint declaration. That is what CfgServer knows, not your internal variable name


Enviado de meu E6633 usando Tapatalk
[/quote]Perfect!

Thank you so much! :)