Genesys CTI User Forum > Genesys-related Development

PSDK Multiple connection to ConfServer

(1/1)

benjamin:
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]

cavagnaro:
The name maybe? Try to make it dynamic

benjamin:
[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?

cavagnaro:
The name at the endpoint declaration. That is what CfgServer knows, not your internal variable name


Enviado de meu E6633 usando Tapatalk

benjamin:
[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! :)

Navigation

[0] Message Index

Go to full version