Author Topic: PSDK Multiple connection to ConfServer  (Read 2905 times)

Offline benjamin

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
PSDK Multiple connection to ConfServer
« 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]

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: PSDK Multiple connection to ConfServer
« Reply #1 on: October 10, 2017, 01:16:07 PM »
The name maybe? Try to make it dynamic

Offline benjamin

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: PSDK Multiple connection to ConfServer
« Reply #2 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?

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: PSDK Multiple connection to ConfServer
« Reply #3 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

Offline benjamin

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: PSDK Multiple connection to ConfServer
« Reply #4 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! :)