Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
API ERROR
03-14-2013, 06:06 PM,
#1
API ERROR
When i'm ruining below code i'm getting this error - Fatal error: Call to a member function kindOf() on a non-object in C:\wamp\www\webERP\xmlrpc\lib\xmlrpc.inc on line 3310



<?php
include '../webERP/xmlrpc/lib/xmlrpc.inc';

//include 'config.inc';

echo '<a href="index.php">Home</a></BR>';

if (isset($_GET['stockid'])) {
$_POST['stockid']=$_GET['stockid'];
$_POST['submit']='set';
}
if (!isset($_POST['submit'])) {
echo '<FORM METHOD="post" action=' . $_SERVER['PHP_SELF'] . '>Enter stock id';
echo '<INPUT type="text" name="stockid"></BR>';
echo 'Enter Location ID <INPUT type="text" name="locationid"></BR><input type="Submit" name="submit" value="Get Balance">';
echo '</FORM>';
} else {


$stockid = new xmlrpcval($_POST['stockid']);
$user = new xmlrpcval('admin');
$password = new xmlrpcval('abc123');

$msg = new xmlrpcmsg("weberp.xmlrpc_GetStockBalance", array($stockid, $user, $password));


$client = new xmlrpc_client('http://localhost/webERP/api/api_xml-rpc.php');
$client->setDebug(2);

$response = $client->send($msg);

$balances = php_xmlrpc_decode($response->value());

echo "<table border=1>";
if (sizeof($balances)<1) {
echo 'oops, an error number '.$balances[0].' has occurred';
}
for ($i=0;$i<sizeOf($balances[1]);$i++) {
echo "<tr><td>".$balances[1][$i]['loccode']."</td><td>".$balances[1][$i]['quantity']."</td></tr>";
}
echo "</table>";
}
?>
Reply


Messages In This Thread
API ERROR - by Gamini - 03-14-2013, 06:06 PM
RE: API ERROR - by etabaraz - 03-28-2013, 11:54 PM
RE: API ERROR - by Gamini - 04-03-2013, 06:27 PM
RE: API ERROR - by etainsee - 04-03-2013, 09:15 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)