PHP
  Home arrow PHP arrow Page 3 - Using XML-RPC with PHP
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
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? 
PHP

Using XML-RPC with PHP
By: Lucas Marshall
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 28
    2001-12-20

    Table of Contents:
  • Using XML-RPC with PHP
  • Compiling PHP with XML-RPC Support
  • Dissection of a XML-RPC Call
  • Dissection of a XML-RPC Response
  • Creating an XML-RPC Server
  • Creating an XML-RPC Client
  • 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


    Using XML-RPC with PHP - Dissection of a XML-RPC Call


    (Page 3 of 7 )

    An XML-RPC call is sent from a client to a server via HTTP POST. This allows XML-RPC applications to work fairly easily behind firewalls, as port 80 is almost always open.

    Here's a sample XML-RPC call:

    POST xmlrpcexample.php HTTP/1.0 User-Agent: xmlrpc-epi-php/0.2 (PHP) Host: localhost:80 Content-Type: text/xml Content-length: 191 <?xml version='1.0' encoding="iso-8859-1" ?> <methodCall> <methodName>greeting</methodName> <params> <param> <value> <string>Lucas</string> </value> </param> </params> </methodCall>
    The first part of the request is simply a standard HTML post request. It's the data sent in the body of the request that interests us.

    The <methodCall> tags simply encapsulate the call, with all the parameters enclosed in <params> and each parameter enclosed in <param>.

    Parameters are specified enclosed in tags that tell the application what type of parameter they are. In this case, "Lucas" is a string, so it is enclosed in <string>, but there are a lot more parameter types:

    <i4> or <int>
    four-byte signed integer
    10
    <boolean>
    0 (false) or 1 (true)
    1
    <string>
    ASCII string
    Hello, DevShed!
    <double>
    double-precision signed 
    floating point number
    -21.2544
    <dateTime.iso8601>
    date/time
    20011219T12:05:26
    <base64>
    base64-encoded binary
    eW91IGNhbid0IHJlYWQgdGhpcyE=


    In addition to the basic types, there are also <struct>s and <array>s, <struct>s containing any number of <member>s that consist of <name>s and <value>s (specified in the same manner as <param>s):

    <struct> <member> <name>name</name> <value> <string>Lucas Marshall</string> </value> </member> <member> <name>age</name> <value> <i4>20</i4> </value> </member> </struct>
    and arrays merely containing any number of <value>s:

    <array> <value><i4>10</i4></value> <value><i4>20</i4></value> <value><i4>30</i4></value> </array>

    More PHP Articles
    More By Lucas Marshall


     

       

    PHP ARTICLES

    - Using Aliases and the Autoload Function with...
    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Sub Classing Exceptions in PHP 5
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT