Miscellaneous
  Home arrow Miscellaneous arrow Page 9 - Remote Procedure Calls with PEAR::XML-RPC
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Forums Sitemap 
Dedicated Servers  
Download TestComplete 
JMSL Numerical Library 
IBM® developerWorks
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

Remote Procedure Calls with PEAR::XML-RPC
By: bluephoenix
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 3
    2004-01-29

    Table of Contents:
  • Remote Procedure Calls with PEAR::XML-RPC
  • The Example Script
  • An XML_RPC Exchange
  • Client Rewritten Example
  • Client Sending
  • Client Receiving
  • Server Rewritten Example
  • Distributed Function Requirements
  • Inside the Function
  • Map and Send
  • The Output
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Remote Procedure Calls with PEAR::XML-RPC - Inside the Function


    (Page 9 of 12 )

    The internal function will be passed the XML-RPC message object when called so it's necessary to be able to gain access to the each argument. Calling getParam against the message to the requested value does this. If the requested parameter doesn't exist then getParam will return undef.

    <?php
    $name1 
    $msg-&gt;getParam(0);
    $name2 $msg-&gt;getParam(1);
    ?>

    The getParam method returns a value object so the actual value needs to be obtained using the scalarvar, arraymem and structmem methods discussed earlier.

    <?php
    $length 
    strlen($name1-&gt;scalarval() . $name2-&gt;scalarval());
    ?>

    After performing the function specific tasks and a result is ready to go, it's packed up as an value object and returned as an response object by XML_RPC_Response.

    <?php
    $result 
    = new XML_RPC_Value$length"int");
    return new 
    XML_RPC_Response($result);
    ?>

    More Miscellaneous Articles
    More By bluephoenix


       · I am Sobhan Palpal_sobhan@hotmail.comenjoy php!!live and let...
       · f
       · kk
     

    MISCELLANEOUS ARTICLES

    - Stopping CSRF Attacks in Your PHP Applicatio...
    - Quick and Dirty AJAX Tutorial
    - Flickr Puzzle Mashup
    - The PAVISE of Security
    - Creating a CAPTCHA with PHP
    - Sending SMS Thru HTTP
    - The Postal Fix - Part 2
    - Adding Mail with Exim
    - The Postal Fix - Part 1
    - Create Your Own Custom API
    - Adding Drop Shadows with PHP
    - Writing a Basic Authentication System in PHP
    - Overlapping Images with GD
    - Using Sockets in PHP
    - Dynamic CSS with PHP






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway