Miscellaneous

  Home arrow Miscellaneous arrow Page 6 - 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 - Client Receiving


    (Page 6 of 12 )

    A value object is extracted from the response by the response object's value method. For scalar values, the value's type can then be extracted with scalartype and the value extracted with scalarval.

    <?php
    $value 
    $result-&gt;value();
    $number $value-&gt;scalarval();
    ?>

    Again, serialize can be used to view the message and response XML.

    <?php
    echo "&lt;p&gt;&lt;b&gt;Return Value:&lt;/b&gt; $number &lt;/p&gt;";
    echo 
    "&lt;p&gt;&lt;b&gt;Received XML Message:&lt;/b&gt;";
    echo 
    "&lt;pre&gt;" htmlentities($result-&gt;serialize()) . "&lt;/pre&gt;&lt;/p&gt;";

    echo 
    "&lt;p&gt;$first $last's name is $number letters long.&lt;/p&gt;";
    ?>

    The arraymem and structmem methods are used to extract a specified array or structure member. For example:

    <?php
    $value 
    $result-&gt;arraymem($n);
    $value $result-&gt;structmem($memberName);
    ?>

    The arraymem method returns element $n of $result as a value object. The structmem method returns $memberName of $result as a value object.

    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 3 - Follow our Sitemap