QueueMetrics forum
QueueMetrics => Scripting QueueMetrics => Topic started by: cx2x3 on August 14, 2009, 15:12:02
-
Has anyone tried to get XmlRpc working in .Net ? .. I need some pointers and sample code just to get started .. do we need to install something on our server? or what would be the default location for this xmlrpc.do page?
-
You can ask for the xmlrpc page as of http://server:8080/queuemetrics/xmlrpc.do - it's a virtual page, it does not exist on the filseystem!
-
hi cx2x3
I have implemented a small code which implements xmlrpc server (web service) and xmlrpc client
in xmlrpc.net dll . no need to install anything on server ..ofcourse the web service will be on server ..
nut in code just add reference to cookcomputing.xmlrpc dll
:)
-
Thanks all.. I am trying to call the QM.stats method
in the examples - they use an Java ArrayList .. if I use a C#/.Net ArrayList I get a "Parameter count mismatch." error
also tried to just change it to string but then I get another error...
Server returned a fault exception: [-1] redstone.xmlrpc.XmlRpcException: The method cannot be found. Signature: java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String java.lang.String
has anyone got .net (VB or C#) code that works for this method (QM.stats)
-
any help here guys?
I have enable my robot user and now i'm using robot to connect but still get the same errors?
Is it maybe something to do with the ArrayList that QM.stats expects as a the last parameter .. Is a .net ArrayList the same as a Java ArrayList ?
-
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());
}
}
}
-
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!
-
Cool man - by the way that's the way your XML-RPC library does the translation to the basic XML-RPC data types.