this is my cakephp XMLRPC client component that i used on my last project.
*I still have trouble with code snippet with wordpress. then i cant exposed here. just download from link above*
original file name : xml_client.php
usage:
1. set host, port and param with these method:
[a] Set it on class variable initiation
var $host = "SET HOST HERE";
var $port = "SET PORT HERE;
var $path = "SET PATH HERE";
[b] Set it with setter method from controller:
$this-XmlClient->set_host("SET HOST HERE");
$this->XmlClient->set_port("SET PORT HERE");
$this->XmlClient->set_path("SET PATH HERE");
2. do xmlrpc client
$response = $this->XmlClient->do_call("function method",array(parameter,parameter,...));
note:
[1] $response from do_call function is in array form (not xml form). if you want the raw response (which http header still available), you can get from
$rawresponse = $this->XmlClient->rawResponse
.
[2] To detect wether response was fault response, you can check with
$this->XmlClient->is_fault_response();
and, you can fetch fault string (“FAULT STRING BLA BLA BLA (err code: FAULT CODE)”) with this method
$fault_string = $this->XmlClient->get_fault_string();
[3] this component only works for http 1/1 protocol.
[4] this component need php’s xmlrpc extensions (–with-xmlrpc)
thats all.
any comment?
it says…
Fatal error: Call to undefined method XmlClientComponent::set_param() in
Oleh: rdeman on 8/Juli/2007
at 12:22 am
rdeman:
yes, you right.
i forgot to delete line
“$this->set_param();”
below line
function do_call() {
you could delete that line and try again, or download the new one (from the same link above). :)
thx a lot.
Oleh: kod34fr33 on 9/Juli/2007
at 9:38 am