Miscellaneous

  Home arrow Miscellaneous arrow Page 9 - Remote Procedure Calls with PEAR::XML-...
MISCELLANEOUS

Remote Procedure Calls with PEAR::XML-RPC
By: bluephoenix
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    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

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    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

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 2 - Follow our Sitemap