2 require_once(dirname(__FILE__
) . "/../freeb/xmlrpc.inc");
3 require_once(dirname(__FILE__
) . "/../freeb/xmlrpcs.inc");
10 function WSWrapper($function,$send = true) {
11 $this->_config
= $GLOBALS['oer_config']['ws_accounting'];
12 //print_r($this->_config);
13 if (!$this->_config
['enabled']) return;
16 $this->send($function);
20 function send($function) {
21 list($name,$var) = each($function);
22 $f=new xmlrpcmsg($name,$var);
23 //print "<pre>" . htmlentities($f->serialize()) . "</pre>\n";
24 $c=new xmlrpc_client($this->_config
['url'], $this->_config
['server'],$this->_config
['port']);
25 $c->setCredentials($this->_config
['username'],$this->_config
['password']);
28 if (!$r) { echo("send failed"); }
31 $this->value
= $tv->getval();
37 if ($r->faultCode()) {
39 echo "Code: " . $r->faultCode() . " Reason '" .$r->faultString()."'<BR>";