webERP开源
下面是 PHP Client soap Client API。如何将此 PHP 客户端脚本转换为 JAVA 客户端脚本。
客户端程序包含 5 个参数。
<?php
include 'xmlrpc/lib/xmlrpc.inc';
include 'config.inc';
echo '<a href="index.php">Home</a></BR>';
$_POST['debtor'] = "ARGUMENT 1";
$weberpuser = "ARGUMENT 2";
$weberppassword = "ARGUMENT 3";
$DebugLevel = 1;
$ServerURL = "ARGUMENT 4";
if (isset($_GET['debtorno'])) {
$_POST['debtor']=$_GET['debtorno'];
$_POST['submit']='set';
}
if (!isset($_POST['submit'])) {
echo '<FORM METHOD="post" action=' . $_SERVER['PHP_SELF'] . '>Enter customer code';
echo '<INPUT type="text" name="debtor"></BR><input type="Submit" name="submit" value="Find Customer">';
echo '</FORM>';
} else {
$debtorno = new xmlrpcval($_POST['debtor']);
$user = new xmlrpcval($weberpuser);
$password = new xmlrpcval($weberppassword);
// weberp.xmlrpc_GetCustomer ARGUMENT 5
$msg = new xmlrpcmsg("weberp.xmlrpc_GetCustomer", array($debtorno, $user, $password));
$client = new xmlrpc_client($ServerURL);
$client->setDebug($DebugLevel);
$response = $client->send($msg);
$debtor = php_xmlrpc_decode($response->value());
echo "<table border=1>";
if (sizeof($debtor)<20) {
echo 'oops, an error number '.$debtor[0].' has occurred';
}
foreach ($debtor as $key => $value) {
if (!is_numeric($key)) {
echo "<tr><td>".$key."</td><td>".$debtor[$key]."</td></tr>";
}
}
echo "</table>";
}
?>
请告知webERP休息服务。