Here is some sample code to get you started.
Please take some time to
1 - get some basic knowledge of the xmlrpc protocol
2 - read the documentation that specifies the bookings.com API

<?php

include("xmlrpc.inc");

$xmlrpc_client = new xmlrpc_client('
http://www.bookings.com/xmlrpcqueryserver');

// use this to have a complete dump of the xmlrpc transaction on the screen
$xmlrpc_client->setDebug(2);

// the actual parameters to be used in calling the remote method depend on
the specific API exposed by the server
$xmlrpc_msg = new xmlrpcmsg('bookings.getCountries');
$xmlrpc_msg->addParam(new xmlrpcval('NZ','string'));
$xmlrpc_msg->addParam(new xmlrpcval(0,'int'));

$xmlrpc_resp = $xmlrpc_client->send($xmlrpc_msg);

// remember to check for errors in the received response
if ($xmlrpc_resp->faultCode()) {
    print "Fault: Code: ".$xmlrpc_resp->faultCode();
    print " Reason '".$xmlrpc_resp->faultString();
} else {
    $decoded_response = php_xmlrpc_decode($xmlrpc_resp->value());
    print "Response: ".$decoded_response;
}

?>

Bye
Gaetano


On 8/21/07, Jongilanga Guma <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I need a php example script that does a search, I have a pool on
> bookings.com where I can search for hotel bookings country, cities,
> etc. I am a newbie on xml.
>
> I have my methods for example bookings.getCountries, that returns:
> <methodResponse>
> <param>
> <params>
> <value>
> <struct>
> <member><name>name</name>
> <value><string>New Zealand</string></value>
> </me




mber>
> <member><name>languagecode</name>
> <value><string>da</string></value>
> </member>
> </struct>
> </value>
> </params>
> </param>
> </methodResponse>
>
> Apologizes if this is not irrelevant to this list,
>
> Regards,
> Jongi
> _______________________________________________
> phpxmlrpc mailing list
> phpxmlrpc@lists.usefulinc.com
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
>
_______________________________________________
phpxmlrpc mailing list
phpxmlrpc@lists.usefulinc.com
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc

Reply via email to