public async Task GetDevicesTest() { using SimpleClicksSoapClient client = await new SimpleClicksSoapClient( new Uri(ServiceUri), new NetworkCredential(Username, Password)).Configure(); GetAgentsResponse getAgents = await client.Request <GetAgentsResponse>(new GetAgentsRequest()); GetDevicesResponse getDevices = await client.Request <GetDevicesResponse>(new GetDevicesRequest(getAgents.Agents[0].AgentId)); TestContext.WriteLine(JsonSerializer.Serialize(getDevices, new JsonSerializerOptions() { WriteIndented = true })); Assert.IsNotNull(getDevices); }
public async Task GetCountersTest() { using SimpleClicksSoapClient client = await new SimpleClicksSoapClient( new Uri(ServiceUri), new NetworkCredential(Username, Password)).Configure(); GetAgentsResponse getAgents = await client.Request <GetAgentsResponse>(new GetAgentsRequest()); GetDevicesResponse getDevices = await client.Request <GetDevicesResponse>(new GetDevicesRequest(getAgents.Agents[0].AgentId)); XDocument xml = await client.Request(new GetCountersRequest(getAgents.Agents[0].AgentId, getDevices.Devices[0].DeviceId)); TestContext.WriteLine(xml); Assert.IsNotNull(getAgents); }