0% found this document useful (0 votes)
16 views3 pages

XML-RPC with Incutio PHP Library

This document provides an introduction to XML-RPC and how to use the Incutio PHP Library to make and receive XML-RPC requests. XML-RPC allows different computers to execute functions remotely over the internet in a similar way to calling local PHP functions. The library makes it simple to create XML-RPC clients and servers. Examples are given of making requests to retrieve data, passing arguments, and handling errors. Creating an XML-RPC server with the library only requires mapping method names to functions.

Uploaded by

Weedhat Utol Uyo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

XML-RPC with Incutio PHP Library

This document provides an introduction to XML-RPC and how to use the Incutio PHP Library to make and receive XML-RPC requests. XML-RPC allows different computers to execute functions remotely over the internet in a similar way to calling local PHP functions. The library makes it simple to create XML-RPC clients and servers. Examples are given of making requests to retrieve data, passing arguments, and handling errors. Creating an XML-RPC server with the library only requires mapping method names to functions.

Uploaded by

Weedhat Utol Uyo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like