Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
API ERROR
03-28-2013, 11:54 PM, (This post was last modified: 04-04-2013, 07:31 AM by phil.)
#2
RE: API ERROR
(03-14-2013, 06:06 PM)Gamini Wrote: 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>";
}
?>

Hi, what information did you get before this error message. With debug level at 2 there was probably a lot of information sent. Can you either post it here, and/or email it directly to me at tim@weberpafrica.com.

This error means that webERP is returning some information that is not correctly formed xml, probably meaning that it is generating an error message. I take it the userid/password combination you are sending is a genuine webERP login?

Thanks
Tim

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)