QueueMetrics > Scripting QueueMetrics
C# examples using CookComputing.XmlRpcV2.dll
cx2x3:
this is the code I'm using .. maybe someone can spot the problem.. it crashes on the second last line where the call is made to GetStats
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CookComputing.XmlRpc;
namespace AstrixMonitor
{
[XmlRpcUrl("http://QueueMetricsServer:8080/QueueMetrics/xmlrpc.do")]
public interface IQueueMetrics
{
[XmlRpcMethod("QM.stats")]
Object GetStats(string queueNames,
string userName, string password,
string logfile, string period, // always leave these 2 X fields blank
string startOfPeriod, string endOfPeriod, //yyyy-mm-dd.hh.mm.ss (do not forget the dot between the date and the hour)
string agentFilter,
string analysisNames);
}
public partial class Monitor : Form
{
DataSet dsDropped;
DataTable tblDropped;
public Monitor()
{
InitializeComponent();
GetData();
dataGridView1.DataSource = dsDropped;
dataGridView1.DataMember = "tblDropped";
}
private void GetData()
{
ArrayList analysisNames = new ArrayList();
analysisNames.Add("KoDO.DiscCauses");
//analysisNames.Add("CallDistrDO.AnsDistrPerDay");
IQueueMetrics QueueMetrics = (IQueueMetrics)XmlRpcProxyGen.Create(typeof(IQueueMetrics));
Object result = QueueMetrics.GetStats("9002", "robot", "robot", "", "",
"2009-08-12.00.00.00",
"2009-08-14.00.00.00", "", analysisNames.ToString());
MessageBox.Show(result.ToString());
}
}
}
cx2x3:
OK I found the problem - XMLRPC doesn't like C#'s ArrayList - I changed it to a normal string array and now it works :-)
string[] analysisNames = new string[] { "KoDO.DiscCauses", "CallDistrDO.AnsDistrPerDay"};
thanks!
QueueMetrics:
Cool man - by the way that's the way your XML-RPC library does the translation to the basic XML-RPC data types.
Navigation
[0] Message Index
[*] Previous page
Go to full version