7/10/12
XML-RPC Librar - a Beginners Guide
INCUTIOHOME SCRIPTS CONTACT ManualIndex
XMLRPCwiththeIncutioPHPLibrar :ABeginner'sGuide
[Link] overtheinternet. WhatthismeansisthatdifferentcomputerscanuseXMLRPCto"askeachotherquestions".UsingXMLRPC isjustlikemakingafunctioncallinPHP,onlythecomputerthatexecutesthefunctioncouldbethousandsofmiles away. WiththeIncutioXMLRPCLibrary,makingandreceivingXMLRPCrequestsisalmostassimpleascalling [Link]'ssomesamplecode,whichcallsafunctionentitled"[Link]"onoursimple demonstrationserver:
$client=newIXR_Client('[Link] $client>query('[Link]') print$client>getResponse() //Printsthecurrenttime,accordingtoourwebserver
Witherrorchecking,theabovecodelookslikethis:
$client=newIXR_Client('[Link] if(!$client>query('[Link]')){ die('Anerroroccurred'.$client>getErrorCode().":".$client>getErrorMessage()) print$client>getResponse()
Youcanalsosendargumentsalongwithyourqueries:
$client=newIXR_Client('[Link] if(!$client>query('[Link]',4,5)){ die('Anerroroccurred'.$client>getErrorCode().":".$client>getErrorMessage()) print$client>getResponse() //Prints'9'
[Link]:
$client=newIXR_Client('[Link] if(!$client>query('[Link]',array(3,5,7))){ die('Anerroroccurred'.$client>getErrorCode().":".$client>getErrorMessage()) print$client>getResponse() //Prints'3+5+7=15'
[Link]'[Link]:
[Link]/ mlrpc/[Link] 1/3
7/10/12
XML-RPC Librar - a Beginners Guide
[Link]'[Link]:
<?php include('IXR_Library.[Link]') /*Functionsdefiningthebehaviouroftheserver*/ functiongetTime($args){ returndate('H:i:s') functionadd($args){ return$args[0]+$args[1] functionaddArray($array){ $total=0 foreach($arrayas$number){ $total+=$number returnimplode('+',$array).'='.$total /*CreatetheserverandmaptheXMLRPCmethodnamestotherelevantfunctions*/ $server=newIXR_Server(array( '[Link]'=>'getTime', '[Link]'=>'add', '[Link]'=>'addArray' )) ?>
Prett simplehuh? TheIncutioXMLRPCLibrar [Link] moreinformation. Scripts ScriptsHome PHPXMLRPCLibrar PHPAma onSearch PHPGoogleWebAPI incDirector ssLinks
[Link]/ mlrpc/[Link]
2/3
7/10/12
XML-RPC Librar - a Beginners Guide
Design,Content,Images 20022012IncutioLimited|W3CXHTML1.0
[Link]/ mlrpc/[Link]
3/3