Author Topic: XML-RPC - problems using the QM.realtime method  (Read 5808 times)

euge

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
    • Email
XML-RPC - problems using the QM.realtime method
« on: June 18, 2007, 18:32:31 »
Hi,

We are using queuemetrics 1.3.5 version.

We made succesfull tests using the QM.stats and QM.auth methods but when we
call the QM.realtime method we receibe an error saying that this method
didn't exist. can be possible that this method is not implemented yet or we
are making something wrong?

the error is:

Fault Code: -1 Fault Reason: 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 redstone.xmlrpc.XmlRpcArray

the php code is as follows:

Quote
<h1>A QueueMetrics XML-RPC client in PHP</h1>
<?
require_once 'XML/RPC.php';
$qm_server = "192.168.254.164"; // the QueueMetrics server address
$qm_port   = "8080";        // the port QueueMetrics is running on
$qm_webapp = "queuemetrics/qm"; // the webapp name for QueueMetrics

//llamadas en curso

$req_blocks_rt = new XML_RPC_Value(array(
                 new XML_RPC_Value("RealtimeDO.RTRiassunto"),
      new XML_RPC_Value("RealtimeDO.RTCallsBeingProc")
           ), "array");
// general invocation parameters - see the documentation
$params_rt = array(
     new XML_RPC_Value("9"),
           new XML_RPC_Value("robot"),
           new XML_RPC_Value("robot"),
           new XML_RPC_Value(""),
           new XML_RPC_Value(""),
           new XML_RPC_Value(""),
           $req_blocks_rt
       );
$msg_rt = new XML_RPC_Message('QM.rt', $params_rt);
$cli_rt = new XML_RPC_Client("/$qm_webapp/xmlrpc.do", $qm_server,$qm_port);
$cli_rt->setDebug(1);
$resp_rt = $cli_rt->send($msg_rt);
if (!$resp_rt) {
    echo 'Communication error: ' . $cli_rt->errstr;
    exit;
}
if ($resp_rt->faultCode()) {
    echo 'Fault Code: ' . $resp_rt->faultCode() . "\n";
    echo 'Fault Reason: ' . $resp_rt->faultString() . "\n";
} else {
    $val_rt = $resp_rt->value();
    $blocks_rt = XML_RPC_decode($val_rt);
    // now we print out the details....
    printBlock( "result", $blocks_rt );
    printBlock( "RealtimeDO.RTRiassunto", $blocks_rt );
}

// output a response block as HTML
function printBlock( $blockname, $blocks ) {
     echo "<h2>Response block: $blockname </h2>";
     echo "<table border=1>";
     $block = $blocks[$blockname];
     for ( $r = 0; $r < sizeof( $block ); $r++ ) {
           echo "<tr>";
           for ( $c = 0; $c < sizeof( $block[$r] ); $c++ ) {
                echo( "<td>" . $block[$r][$c] . "</td>" );
           }
           echo "</tr>\n";
     }
     echo "</table>";
}
?>


QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: XML-RPC - problems using the QM.realtime method
« Reply #1 on: June 20, 2007, 17:33:46 »
There are two things wrong:

1. the method call is:

Code: [Select]
$params_rt = array(
      new XML_RPC_Value("9"),
           new XML_RPC_Value("robot"),
           new XML_RPC_Value("robot"),
           new XML_RPC_Value(""),
           new XML_RPC_Value(""),
           $req_blocks_rt
       );

That is you have one "" too much in your example, and

2. the method to call is QM.realtime and not QM.rt

Code: [Select]
$msg_rt = new XML_RPC_Message('QM.realtime', $params_rt);
If you do it like this, it works just fine! 


euge

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
    • Email
Re: XML-RPC - problems using the QM.realtime method
« Reply #2 on: June 21, 2007, 10:59:57 »



























































Yes!! now works perfect!  :D
Thanks