【问题标题】:Use IConfService to query object by Attributes使用 IConfService 按属性查询对象
【发布时间】:2017-07-12 20:34:12
【问题描述】:

如何使用 Genesys Platform 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);

【问题讨论】:

    标签: genesys workspace-desktop-edition genesys-platform-sdk


    【解决方案1】:

    这对我有用:

    CfgXPathBasedQuery query = new CfgXPathBasedQuery(confService, CfgObjectType.CFGPerson, "CfgPerson[@externalID='the value']");
    

    【讨论】:

      【解决方案2】:

      在下面使用:

      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进行过滤。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-05-16
        • 1970-01-01
        • 2021-10-26
        • 1970-01-01
        • 1970-01-01
        • 2014-02-12
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多