1

如何使用 Genesys 平台 SDK 按属性(而不是“筛选键”)查询对象?

Endpoint endpoint = new Endpoint("DEV", "the host", 12020);

endpoint.ServicePrincipalName = "the host/the principle";

_confServerProtocol = new ConfServerProtocol(endpoint);
_confServerProtocol.ClientApplicationType = (int)CfgAppType.CFGSCE;
_confServerProtocol.ClientName = "default";
_confServerProtocol.UserName = "the userid";
_confServerProtocol.Open();

IConfService confService = ConfServiceFactory.CreateConfService(_confServerProtocol);

CfgPersonQuery query = new CfgPersonQuery();

// Need to filter based on an Attribute Value (specifically externalID)

var foo = confService.RetrieveMultipleObjects<CfgPerson>(query);
4

2 回答 2

1

这对我有用:

CfgXPathBasedQuery query = new CfgXPathBasedQuery(confService, CfgObjectType.CFGPerson, "CfgPerson[@externalID='the value']");
于 2017-07-12T20:39:03.653 回答
0

下面使用:

Uri uri = new Uri("tcp://Host:Port");
Endpoint endpoint = new Endpoint(Guid.NewGuid().ToString(), uri);            
ConfServerProtocol confProtocol = new ConfServerProtocol(endpoint);
confProtocol.ClientApplicationType = (int)CfgAppType.CFGSCE;
confProtocol.ClientName = "default";
confProtocol.UserName = "xxxxxx";
confProtocol.UserPassword = "xxxxxx";

//Channel Open
confProtocol.Open();
IConfService confService = ConfServiceFactory.CreateConfService(confProtocol);

CfgPersonQuery query = new CfgPersonQuery();
query.UserName = "AgentID";
CfgPerson person = confService.RetrieveObjects<CfgPerson>(query);
string ExtID = person.ExternalId;

注意:这种方式无法通过 ExternalId 进行过滤。

于 2019-12-31T08:40:23.197 回答