private static async Task <DocumentResult> LoadFromServiceAsync(string dokumentNummer)
        {
            var client = new RisClient();
            var result = await client.GetDocumentAsync(dokumentNummer);

            if (result.Succeeded)
            {
                return(result);
            }

            return(null);
        }
示例#2
0
        public void Connect(string Server, string Username, string Password, bool verify = true)
        {
            Loaded = false;
            var settings = new UcClientSettings
            {
                Server   = Server,
                User     = Username,
                Password = Password
            };

            if (verify)
            {
                var tempClient  = new AxlClient(settings);
                var testResults = tempClient.Execute(client =>
                {
                    var res = client.getAppUser(new GetAppUserReq
                    {
                        ItemElementName = ItemChoiceType102.userid,
                        Item            = Username
                    });
                });

                if (testResults.Exception != null)
                {
                    throw testResults.Exception;
                }
                else
                {
                    Client     = tempClient;
                    RisClient  = new RisClient(settings);
                    PerfClient = new PerfClient(settings);
                    Loaded     = true;
                }
            }
            else
            {
                Client     = new AxlClient(settings);
                RisClient  = new RisClient(settings);
                PerfClient = new PerfClient(settings);
                Loaded     = true;
            }
        }
示例#3
0
        public void SelecCmDevice()
        {
            var risClient = new RisClient(new UcClientSettings {
                Server = "10.10.20.1", User = "******", Password = "******"
            });

            var result = risClient.Execute(client =>
            {
                var criteria = new CmSelectionCriteria()
                {
                    MaxReturnedDevices = 1000,
                    DeviceClass        = "Any",
                    Model       = 255,          //refers to any device, full listing here: https://developer.cisco.com/site/sxml/documents/api-reference/risport/#ModelTable
                    Status      = "Any",
                    NodeName    = string.Empty, //null for all nodes
                    SelectBy    = CmSelectBy.Name,
                    SelectItems = new ArrayOfSelectItem()
                    {
                        new SelectItem()
                        {
                            Item = "SIPTrunktoCUP"
                        }
                    },
                    //SelectItems = new ArrayOfSelectItem(),  //blank for everything
                    Protocol       = ProtocolType.Any,
                    DownloadStatus = DeviceDownloadStatus.Any,
                };

                var res = client.selectCmDevice(string.Empty, criteria);
                return(res);
            });

            if (result.Exception != null)
            {
                throw result.Exception;
            }

            Assert.IsTrue(result.Value.SelectCmDeviceResult.TotalDevicesFound == 1);
        }