7 public function __construct($url, $namespace = '')
9 $this->namespace = $namespace;
10 $this->request
= new HttpRequest($url, HTTP_METH_POST
);
11 $this->request
->setContentType('text/xml');
14 public function setOptions($options = array())
16 return $this->request
->setOptions($options);
19 public function addOptions($options)
21 return $this->request
->addOptions($options);
24 public function __call($method, $params)
26 if ($this->namespace) {
27 $method = $this->namespace .'.'. $method;
29 $this->request
->setRawPostData(xmlrpc_encode_request($method, $params));
30 $response = $this->request
->send();
31 if ($response->getResponseCode() != 200) {
32 throw new Exception($response->getBody(), $response->getResponseCode());
34 return xmlrpc_decode($response->getBody(), 'utf-8');
37 public function getHistory()
39 return $this->request
->getHistory();