Revision [1755]

Last edited on 2010-01-22 02:31:37 by PhilDaintree
Additions:
Tim has prepared some [[http://www.weberp.org/uploads/ScreenShotUploads/xmlrpc.zip example scripts]] showing how a number of the API XML-RPC functions are called - these scripts can be put on a web-server outside a webERP installation - all you need to do is edit the config.inc file to give the system your webERP username and password and the URL of your webERP installation you wish to connect to.
Deletions:
Tim has prepared some [[http://schofield.homelinux.net/xmlrpc.zip example scripts]] showing how a number of the API XML-RPC functions are called - these scripts can be put on a web-server outside a webERP installation - all you need to do is edit the config.inc file to give the system your webERP username and password and the URL of your webERP installation you wish to connect to.


Revision [1533]

Edited on 2009-07-14 19:05:09 by PhilDaintree
Additions:
I have had a go at an example xml-rpc client script to retrieve the stock quantities of an item using the [[http://web-erp.cvs.sourceforge.net/viewvc/*checkout*/web-erp/webERP/doc/Manual/ManualAPIFunctions.php doc/Manual/ManualAPIFunctions.php]] as a template.
Deletions:
I have had a go at an example xml-rpc client script to retrieve the stock quantities of an item using the doc/Manual/ManualAPIFunctions.php as a template.


Revision [1479]

Edited on 2009-05-03 21:59:34 by PhilDaintree
Additions:
Tim has prepared some [[http://schofield.homelinux.net/xmlrpc.zip example scripts]] showing how a number of the API XML-RPC functions are called - these scripts can be put on a web-server outside a webERP installation - all you need to do is edit the config.inc file to give the system your webERP username and password and the URL of your webERP installation you wish to connect to.
Deletions:
Here is a [[http://schofield.homelinux.net/xmlrpc.zip demonstration of the api at work]]


Revision [1478]

Edited on 2009-05-03 21:54:48 by PhilDaintree
Additions:
$Parameters['StockID'] = xmlrpcval('DVD-TOPGUN'); //the stockid of the item we wish to know the balance for
Deletions:
$Parameters['StockID'] = xmlrpcval('DVD_TOPGUN'); //the stockid of the item we wish to know the balance for


Revision [1472]

Edited on 2009-05-01 08:04:55 by TimSchofield
Additions:
Here is a [[http://schofield.homelinux.net/xmlrpc.zip demonstration of the api at work]]


Revision [1471]

Edited on 2009-05-01 02:55:35 by PhilDaintree
Additions:
echo 'Test Tims webERP API';
Deletions:
echo 'Test Tim's webERP API';


Revision [1470]

Edited on 2009-05-01 02:55:09 by PhilDaintree
Additions:
echo 'Test Tim's webERP API';
echo '';
Deletions:
%%

Test Tim's webERP API

%%
%%
%%


Revision [1469]

Edited on 2009-05-01 02:53:48 by PhilDaintree
Additions:
%%
%%
%%(php) ?>%%
%%
Deletions:
%%(php)
?>


Revision [1468]

Edited on 2009-05-01 02:52:33 by PhilDaintree
Additions:

Test Tim's webERP API

?>

%%
Deletions:
?>%%


Revision [1467]

Edited on 2009-05-01 02:51:36 by PhilDaintree
Additions:
/*The trap for me was that each parameter needs to be run through xmlrpcval() - to create the necessary xml required for the rpc call
if one of the parameters required is an array then it needs to be processing into xml for the rpc call through php_xmlrpc_encode()*/
$Parameters['StockID'] = xmlrpcval('DVD_TOPGUN'); //the stockid of the item we wish to know the balance for
$Parameters['Username'] = xmlrpcval('admin');
$Parameters['Password'] = xmlrpcval('weberp');
Deletions:
$Parameters['StockID'] = 'DVD_TOPGUN'; //the stockid of the item we wish to know the balance for
$Parameters['Username'] = 'admin';
$Parameters['Password'] = 'weberp';


Revision [1466]

Edited on 2009-05-01 02:04:15 by PhilDaintree
Additions:
//you need to include the phpxmlrpc class - see link above - copy the whole directory structure of the class over to your client application
include ("xmlrpc/lib/xmlrpc.inc");
Deletions:
//you need to include the phpxmlrpc class - see link above
include ("xmlrpc.inc");


Revision [1465]

Edited on 2009-05-01 01:49:53 by PhilDaintree
Additions:
//the xmlrpc class can output some funny warnings so make sure notices are turned off
error_reporting (E_ALL & ~E_NOTICE);


Revision [1464]

Edited on 2009-05-01 01:46:15 by PhilDaintree
Additions:
//you need to include the phpxmlrpc class - see link above
include ("xmlrpc.inc");


Revision [1463]

Edited on 2009-04-30 21:28:42 by PhilDaintree
Additions:
I have had a go at an example xml-rpc client script to retrieve the stock quantities of an item using the doc/Manual/ManualAPIFunctions.php as a template.


Revision [1462]

Edited on 2009-04-30 21:19:51 by PhilDaintree
Additions:
Simply put the XML_RPC call is XML that contains the method of the remote procedure call and any parameters and their data types and is sent over http as a POST to the XML-RPC server - the server returns an XML payload containing the results of the call.
Deletions:
Simply put the XML_RPC call is XML that contains the method of the remote procedure call and any parameters and their data types and is sent over http to the XML-RPC server - the server returns an XML payload containing the results of the call.


Revision [1461]

Edited on 2009-04-30 21:17:23 by PhilDaintree
Additions:
//need to figure out how to return all the error descriptions associated with the codes


Revision [1460]

Edited on 2009-04-30 21:13:49 by PhilDaintree
Additions:
$answer = php_xmlrpc_decode($response->value());
if ($answer[0]!=0){ //then the API returned some errors need to figure out what went wrong

} else { //all went well the returned data is in $answer[1]
//answer will be an array of the locations and quantity on hand for DVD_TOPGUN so we need to run through the array to print out
for ($i=0; $i echo '
' . $answer[1][$i]['loccode'] . ' has ' . $answer[1][$i]['quantity'] . ' on hand';
}
Deletions:
$signature = php_xmlrpc_decode($response->value());


Revision [1459]

Edited on 2009-04-30 20:51:22 by PhilDaintree
Additions:
Tim's API help which itself is produced by an xml-rpc call to the API using the system.listMethods method (I think this is a phpxmlrpc method - not a webERP API method) - he then uses another system xml-rpc method of phpxmlrpc class to return the details of each method's parameters required. So the help file not only documents each of the API methods it is itself and illustration of how the API can be used!!
Deletions:
Tim's API help which itself is produced by an xml-rpc call to the API using the system.listMethods method (I think this is a phpxmlrpc method - not a webERP API method) - he then uses another system xml-rpc method of phpxmlrpc class to return the details of each method's parameters required. So the help file not only documents each of the API methods it is itself and illustration of how the API can be used.


Revision [1458]

Edited on 2009-04-30 20:49:26 by PhilDaintree
Additions:
%%http://www.yourdomain.com/webERP/api/api_xml-rpc.php%%
Deletions:
"http://www.yourdomain.com/webERP/api/api_xml-rpc.php"


Revision [1457]

The oldest known version of this page was created on 2009-04-30 20:48:42 by PhilDaintree
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki