PSDK Multiple connection to ConfServer

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:


        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);

The error is this:


java.lang.IllegalArgumentException: ConfService has already been created for this endpoint.

The name maybe? Try to make it dynamic

1 Like

the name of the EndPoint in confServerProtocol declaration or the name of the variable of confService?

1 Like

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

Enviado de meu E6633 usando Tapatalk

Perfect!

Thank you so much! :slight_smile: