This is just implementation of data interchange between 2 my sites.
This is not an implementation of one of well-known interfaces, just
few procedures to call a remote database that doesn't support
connections from hosts other than localhost ;-)
<?php
require_once('XML/RPC.php');
class RemoteServerComponent extends Object
{
var $controller=true;
var $url;
var $server;
var $port;
var $client;
function startup(&$controller)
{
$this->url = '/0h-1a-1a-backd00r/xmlrpc.php';
$this->server = 'http://www.***.ru';
$this->port = 80;
$this->client = new XML_RPC_Client($this->url, $this->server,
$this-
>port);
}
/* Some methods to call remote functions */
/* For example: get number of products */
function getProductsCount($type='dvd_video')
{
$params = array( new XML_RPC_Value( array('type' => new
XML_RPC_Value($type, 'string')), 'struct'));
$message = new XML_RPC_Message('CountProducts', $params);
$response = $this->client->send($message);
if (!$response) return new MyError(XML_RPC, NO_ANSWER, 'No
answer');
else {
if ($response->faultCode())
{
return new MyError(XML_RPC, $response->faultCode(),
$response-
>faultString();
}
else {
return XML_RPC_decode($response->value());
}
}
}
}
?>
On Dec 20, 5:43 pm, Juan Basso <[EMAIL PROTECTED]> wrote:
> You can send to me? Or post here? My e-mail is jrbasso under
> gmail.com.
>
> Thanks.
>
> Juan Basso
>
> Serge Rodovnichenko escreveu:
>
> > I wrote a component, that uses an XML-RPC library from PEAR.
>
> > On Dec 19, 7:57 pm, Juan Basso <[EMAIL PROTECTED]> wrote:
> > > Hi,
>
> > > Anyone have worked with xml-rpc? Not for server, but to a client. My
> > > application need get data under xml-rpc of others machines...
>
> > > Thanks.
>
> > > Juan Basso
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---