Re: Search Example
"Gaetano Giunta" <[email protected]> Sun, 26 Aug 2007 19:58:01 +0200
| Newsgroups | gmane.comp.php.xml-rpc |
|---|---|
| Message-ID | <[email protected]> |
--===============1167832491==
Content-Type: multipart/alternative;
boundary="----=_Part_133467_20436726.1188151081088"
------=_Part_133467_20436726.1188151081088
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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
> [email protected]
> http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
>
------=_Part_133467_20436726.1188151081088
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Here is some sample code to get you started.<br>Please take some time to<br>1 - get some basic knowledge of the xmlrpc protocol<br>2 - read the documentation that specifies the <a href="http://bookings.com">bookings.com</a>
API<br><br><?php<br><br>include("xmlrpc.inc");<br><br>$xmlrpc_client = new xmlrpc_client('<a href="http://www.bookings.com/xmlrpcqueryserver'">http://www.bookings.com/xmlrpcqueryserver'</a>);<br>
<br>// use this to have a complete dump of the xmlrpc transaction on the screen<br>$xmlrpc_client->setDebug(2);<br><br>// the actual parameters to be used in calling the remote method depend on the specific API exposed by the server
<br>$xmlrpc_msg = new xmlrpcmsg('bookings.getCountries');<br>$xmlrpc_msg->addParam(new xmlrpcval('NZ','string'));<br>$xmlrpc_msg->addParam(new xmlrpcval(0,'int'));<br><br>$xmlrpc_resp = $xmlrpc_client->send($xmlrpc_msg);
<br><br>// remember to check for errors in the received response<br>if ($xmlrpc_resp->faultCode()) {<br> print "Fault: Code: ".$xmlrpc_resp->faultCode();<br> print " Reason '".$xmlrpc_resp->faultString();
<br>} else {<br> $decoded_response = php_xmlrpc_decode($xmlrpc_resp->value());<br> print "Response: ".$decoded_response;<br>}<br><br>?><br><br>Bye<br>Gaetano<br><br><br><div><span class="gmail_quote">
On 8/21/07, <b class="gmail_sendername">Jongilanga Guma</b> <<a href="mailto:[email protected]">[email protected]</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I need a php example script that does a search, I have a pool on<br><a href="http://bookings.com">bookings.com</a> where I can search for hotel bookings country, cities,<br>etc. I am a newbie on xml.<br><br>
I have my methods for example bookings.getCountries, that returns:<br><methodResponse><br><param><br><params><br><value><br><struct><br><member><name>name</name><br><value><string>New Zealand</string></value>
<br></me</blockquote><div><br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">mber><br><member><name>languagecode</name>
<br><value><string>da</string></value><br></member><br></struct><br></value><br></params><br></param><br></methodResponse><br><br>Apologizes if this is not irrelevant to this list,
<br><br>Regards,<br>Jongi<br>_______________________________________________<br>phpxmlrpc mailing list<br><a href="mailto:[email protected]">[email protected]</a><br><a href="http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc">
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc</a><br></blockquote></div><br>
------=_Part_133467_20436726.1188151081088--
--===============1167832491==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
phpxmlrpc mailing list
[email protected]
http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc
--===============1167832491==--