Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: nikhiltrivedi84 on February 19, 2016, 05:27:30 PM

Title: COnfServiceFactory.createconfService(Protocol) error
Post by: nikhiltrivedi84 on February 19, 2016, 05:27:30 PM
I am new to using genesys apis. I am trying to use ConfService APIs to access transactions. The issue I am facing is while creating confservice, I am getting a compile error on the ConfServiceFactory.createConfService(protocol) line.

Endpoint cfgServerEndpoint =
            new Endpoint(cfgsrvEndpointName, cfgsrvHost, cfgsrvPort);

    ConfServerProtocol protocol = new ConfServerProtocol(cfgServerEndpoint);
    protocol.setClientName(clientName);
    protocol.setClientApplicationType(clientType.ordinal());
    protocol.setUserName(username);
    protocol.setUserPassword(password);

[i] IConfService service = ConfServiceFactory.createConfService(protocol)[/i]

I am using Genesys Platform SDK 8.0.

Regards

Nikhs
Title: Re: COnfServiceFactory.createconfService(Protocol) error
Post by: nikhiltrivedi84 on February 19, 2016, 05:41:28 PM
These are the imports.

import com.genesyslab.platform.applicationblocks.com.IConfService;
import com.genesyslab.platform.applicationblocks.com.ConfServiceFactory;
import com.genesyslab.platform.applicationblocks.com.ConfigException;

import com.genesyslab.platform.configuration.protocol.types.CfgAppType;
import com.genesyslab.platform.configuration.protocol.ConfServerProtocol;

import com.genesyslab.platform.commons.protocol.ChannelState;
import com.genesyslab.platform.commons.protocol.Endpoint;
import com.genesyslab.platform.commons.protocol.ProtocolException;
Title: Re: COnfServiceFactory.createconfService(Protocol) error
Post by: hsujdik on February 19, 2016, 06:20:55 PM
Try something like this:

protocol = new ConfServerProtocol(cfgServerEndpoint);
protocol.setClientApplicationType(CfgAppType.CFGSCE.asInteger());
protocol.setClientName("default");
protocol.setUserName(username);
protocol.setUserPassword(password);

[i]ConfService confservice = (ConfService) ConfServiceFactory.createConfService(protocol);[/i]
Title: Re: COnfServiceFactory.createconfService(Protocol) error
Post by: nikhiltrivedi84 on February 19, 2016, 07:22:10 PM
It gives me same compilation error. It says "Add argument .......". I think it requires SubScriptionService<message>. What should that do? The confservice sample does not have that.
Title: Re: COnfServiceFactory.createconfService(Protocol) error
Post by: hsujdik on February 19, 2016, 07:28:18 PM
that's strange... It compiles fine here with this.

My imports are:
import com.genesyslab.platform.applicationblocks.com.*;
import com.genesyslab.platform.configuration.protocol.*;
import com.genesyslab.platform.configuration.protocol.types.*;
import com.genesyslab.platform.commons.protocol.*;
Title: Re: COnfServiceFactory.createconfService(Protocol) error
Post by: jamesmurphyau on February 19, 2016, 07:46:34 PM
You're using an old version of the Platform SDK that requires EventBrokerService (EventBrokerService is a subclass of SubscriptionService).. 8.1 has it, 8.5 doesn't
Title: Re: COnfServiceFactory.createconfService(Protocol) error
Post by: nikhiltrivedi84 on February 19, 2016, 08:23:29 PM
James, Do you know how to accomplish this in 8.1 version? The code snippet is shown in below. Let me know what is wrong with it. Appreciate your help.